gridular 2.2.0 → 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/README.md +88 -107
- package/dist/DataGrid.d.ts +3 -0
- package/dist/Pagination.d.ts +12 -0
- package/dist/__tests__/DataGrid.test.d.ts +1 -0
- package/dist/__tests__/setup.d.ts +0 -0
- package/dist/__tests__/utils.d.ts +17 -0
- package/dist/components/ColumnManager.d.ts +13 -0
- package/dist/components/GroupManager.d.ts +11 -0
- package/dist/components/Skeleton.d.ts +7 -0
- package/dist/gridular.css +1 -0
- package/dist/hooks/useDataGrouping.d.ts +14 -0
- package/dist/hooks/useGridPersistence.d.ts +12 -0
- package/dist/hooks/useSelectCell.d.ts +10 -0
- package/dist/index.d.ts +11 -797
- package/dist/lib/utils.d.ts +21 -0
- package/dist/logo.svg +26 -0
- package/dist/stories/customization/CustomRendering.stories.d.ts +8 -0
- package/dist/stories/customization/Themes.stories.d.ts +8 -0
- package/dist/stories/examples/BasicExample.stories.d.ts +9 -0
- package/dist/stories/examples/ComprehensiveDemo.stories.d.ts +6 -0
- package/dist/stories/examples/Pagination.stories.d.ts +6 -0
- package/dist/stories/examples/ServerPagination.stories.d.ts +8 -0
- package/dist/stories/examples/Sorting.stories.d.ts +7 -0
- package/dist/stories/features/CellSelection.stories.d.ts +6 -0
- package/dist/stories/features/ColumnFiltering.stories.d.ts +25 -0
- package/dist/stories/features/ColumnManagement.stories.d.ts +9 -0
- package/dist/stories/features/ColumnMenu.stories.d.ts +33 -0
- package/dist/stories/features/ContextMenu.stories.d.ts +15 -0
- package/dist/stories/features/ExpandableRows.stories.d.ts +7 -0
- package/dist/stories/features/Grouping.stories.d.ts +8 -0
- package/dist/stories/features/RowSelection.stories.d.ts +9 -0
- package/dist/types.d.ts +278 -0
- package/dist/virtualized-grid.js +8915 -0
- package/package.json +71 -80
- package/LICENSE +0 -21
- package/dist/index.d.mts +0 -797
- package/dist/index.js +0 -2866
- package/dist/index.mjs +0 -2766
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { CSSObject } from 'tss-react';
|
|
3
|
+
/**
|
|
4
|
+
* Merges Tailwind classes using clsx and tailwind-merge
|
|
5
|
+
*/
|
|
6
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
7
|
+
/**
|
|
8
|
+
* Merges TSS-React style objects with Tailwind classes
|
|
9
|
+
* Accepts both stringified TSS objects and regular Tailwind class strings
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeStyles(tssStyles?: CSSObject | string, tailwindClasses?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Convert TSS-React CSSObject to inline styles
|
|
14
|
+
* Useful when you need to apply TSS styles directly
|
|
15
|
+
*/
|
|
16
|
+
export declare function tssToInlineStyles(cssObject?: CSSObject): React.CSSProperties;
|
|
17
|
+
/**
|
|
18
|
+
* Spacing helper (Material-UI style)
|
|
19
|
+
* spacing(1) => 4px, spacing(2) => 8px, etc.
|
|
20
|
+
*/
|
|
21
|
+
export declare function spacing(...values: number[]): string;
|
package/dist/logo.svg
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="paint0_linear" x1="74" y1="74" x2="438" y2="438" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop stop-color="#292E49"/>
|
|
5
|
+
<stop offset="0.5" stop-color="#536976"/>
|
|
6
|
+
<stop offset="1" stop-color="#BBD2C5"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
<g fill="url(#paint0_linear)">
|
|
10
|
+
<!-- Top Row -->
|
|
11
|
+
<rect x="154" y="74" width="90" height="90" rx="12"/>
|
|
12
|
+
<rect x="256" y="74" width="90" height="90" rx="12"/>
|
|
13
|
+
<rect x="358" y="74" width="90" height="90" rx="12"/>
|
|
14
|
+
<!-- Middle Row Left -->
|
|
15
|
+
<rect x="74" y="176" width="90" height="90" rx="12"/>
|
|
16
|
+
<!-- Middle Row Right (The G crossbar part) -->
|
|
17
|
+
<rect x="256" y="256" width="90" height="90" rx="12"/>
|
|
18
|
+
<rect x="358" y="256" width="90" height="90" rx="12"/>
|
|
19
|
+
<!-- Bottom Row Left -->
|
|
20
|
+
<rect x="74" y="278" width="90" height="90" rx="12"/>
|
|
21
|
+
<!-- Bottom Row -->
|
|
22
|
+
<rect x="154" y="358" width="90" height="90" rx="12"/>
|
|
23
|
+
<rect x="256" y="358" width="90" height="90" rx="12"/>
|
|
24
|
+
<rect x="358" y="358" width="90" height="90" rx="12"/>
|
|
25
|
+
</g>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const CustomCells: Story;
|
|
7
|
+
export declare const CustomHeaders: Story;
|
|
8
|
+
export declare const CustomRowStyling: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const DarkTheme: Story;
|
|
7
|
+
export declare const MinimalTheme: Story;
|
|
8
|
+
export declare const PlayfulTheme: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const MinimalSetup: Story;
|
|
7
|
+
export declare const SmallDataset: Story;
|
|
8
|
+
export declare const VirtualizedDataset: Story;
|
|
9
|
+
export declare const LargeDataset: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const PotterDBPagination: Story;
|
|
7
|
+
export declare const PotterDBWithGrouping: Story;
|
|
8
|
+
export declare const PotterDBInfiniteScroll: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const BasicSorting: Story;
|
|
7
|
+
export declare const DefaultSorted: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
/**
|
|
7
|
+
* Basic column filtering with text inputs.
|
|
8
|
+
* Click the filter icon in any column header to filter data.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BasicFiltering: Story;
|
|
11
|
+
/**
|
|
12
|
+
* Column filtering with custom filter functions.
|
|
13
|
+
* Different columns can have custom filtering logic.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CustomFilterFunctions: Story;
|
|
16
|
+
/**
|
|
17
|
+
* Column filtering with pagination.
|
|
18
|
+
* Filters are applied before pagination.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FilteringWithPagination: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Disable filtering on specific columns.
|
|
23
|
+
* Set `enableFiltering: false` on individual columns to disable filtering for that column.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SelectiveFiltering: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const ColumnResize: Story;
|
|
7
|
+
export declare const ColumnReorder: Story;
|
|
8
|
+
export declare const ShowHideColumns: Story;
|
|
9
|
+
export declare const AllColumnFeatures: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
/**
|
|
7
|
+
* Basic overflow menu with filter and hide column options.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BasicOverflowMenu: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Custom menu items per column and globally.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CustomMenuItems: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Global default menu items that appear on all columns.
|
|
16
|
+
*/
|
|
17
|
+
export declare const GlobalMenuItems: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Custom filter menu rendering per column.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CustomFilterMenu: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Menu items with nested submenus and keyboard shortcuts.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SubMenusAndShortcuts: Story;
|
|
26
|
+
/**
|
|
27
|
+
* Fully custom column menu rendering per column.
|
|
28
|
+
*/
|
|
29
|
+
export declare const FullyCustomMenu: Story;
|
|
30
|
+
/**
|
|
31
|
+
* Custom trigger button for the column menu.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CustomTrigger: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof DataGrid;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const BasicContextMenu: Story;
|
|
14
|
+
export declare const ConditionalContextMenu: Story;
|
|
15
|
+
export declare const WithoutContextMenu: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const BasicExpanded: Story;
|
|
7
|
+
export declare const ExpandedWithVirtualization: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const BasicGrouping: Story;
|
|
7
|
+
export declare const MultiLevelGrouping: Story;
|
|
8
|
+
export declare const GroupingWithVirtualization: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataGrid } from '../../DataGrid';
|
|
3
|
+
declare const meta: Meta<typeof DataGrid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataGrid>;
|
|
6
|
+
export declare const SingleRowSelection: Story;
|
|
7
|
+
export declare const MultiRowSelection: Story;
|
|
8
|
+
export declare const MultiRowWithModifier: Story;
|
|
9
|
+
export declare const PreselectedRows: Story;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CSSObject } from 'tss-react';
|
|
3
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
4
|
+
export interface ColumnDef<T = any> {
|
|
5
|
+
id: string;
|
|
6
|
+
header: string;
|
|
7
|
+
key: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
enableSorting?: boolean;
|
|
10
|
+
enableFiltering?: boolean;
|
|
11
|
+
enableResize?: boolean;
|
|
12
|
+
enableGrouping?: boolean;
|
|
13
|
+
enableColumnMenu?: boolean;
|
|
14
|
+
filterFn?: (row: T, columnId: string, filterValue: string) => boolean;
|
|
15
|
+
sortFn?: (a: T, b: T, columnId: string) => number;
|
|
16
|
+
headerClassName?: string;
|
|
17
|
+
cellClassName?: string;
|
|
18
|
+
headerStyle?: CSSObject;
|
|
19
|
+
cellStyle?: CSSObject;
|
|
20
|
+
renderCell?: (row: T) => ReactNode;
|
|
21
|
+
cell?: (row: T) => ReactNode;
|
|
22
|
+
render?: (row: T) => ReactNode;
|
|
23
|
+
groupFormatter?: (value: any) => string;
|
|
24
|
+
renderFilterMenu?: (props: FilterMenuRenderProps<T>) => ReactNode;
|
|
25
|
+
columnMenuItems?: ColumnMenuItem[];
|
|
26
|
+
renderColumnMenu?: (props: ColumnMenuRenderProps<T>) => ReactNode;
|
|
27
|
+
index?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface FilterMenuRenderProps<T = any> {
|
|
30
|
+
column: ColumnDef<T>;
|
|
31
|
+
filterValue: string;
|
|
32
|
+
onFilterChange: (value: string) => void;
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
isFiltered: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ColumnMenuItem {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string | ReactNode;
|
|
39
|
+
icon?: ReactNode;
|
|
40
|
+
onClick: (columnId: string) => void;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
danger?: boolean;
|
|
43
|
+
className?: string;
|
|
44
|
+
shortcut?: string;
|
|
45
|
+
subMenu?: ColumnMenuItem[];
|
|
46
|
+
separator?: boolean;
|
|
47
|
+
render?: (props: ColumnMenuItemRenderProps) => ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export interface ColumnMenuItemRenderProps {
|
|
50
|
+
item: ColumnMenuItem;
|
|
51
|
+
columnId: string;
|
|
52
|
+
isDisabled: boolean;
|
|
53
|
+
onSelect: () => void;
|
|
54
|
+
}
|
|
55
|
+
export interface ColumnMenuRenderProps<T = any> {
|
|
56
|
+
column: ColumnDef<T>;
|
|
57
|
+
items: ColumnMenuItem[];
|
|
58
|
+
defaultItems: {
|
|
59
|
+
filter?: ReactNode;
|
|
60
|
+
hideColumn?: ReactNode;
|
|
61
|
+
};
|
|
62
|
+
onClose: () => void;
|
|
63
|
+
}
|
|
64
|
+
export interface SortState {
|
|
65
|
+
column: string;
|
|
66
|
+
direction: 'asc' | 'desc';
|
|
67
|
+
}
|
|
68
|
+
export interface FilterState {
|
|
69
|
+
[columnId: string]: string;
|
|
70
|
+
}
|
|
71
|
+
export interface RowSelectionState {
|
|
72
|
+
[rowId: string]: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface PaginationState {
|
|
75
|
+
pageIndex: number;
|
|
76
|
+
pageSize: number;
|
|
77
|
+
}
|
|
78
|
+
export interface GroupingState {
|
|
79
|
+
groupByColumns: string[];
|
|
80
|
+
expandedGroups: Record<string, boolean>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Class overrides for grid styling
|
|
84
|
+
* Supports both Tailwind classes (string) and TSS-React objects
|
|
85
|
+
*/
|
|
86
|
+
export interface GridClasses {
|
|
87
|
+
container?: string;
|
|
88
|
+
containerStyle?: CSSObject;
|
|
89
|
+
header?: string;
|
|
90
|
+
headerStyle?: CSSObject;
|
|
91
|
+
headerCell?: string;
|
|
92
|
+
headerCellStyle?: CSSObject;
|
|
93
|
+
body?: string;
|
|
94
|
+
bodyStyle?: CSSObject;
|
|
95
|
+
row?: string;
|
|
96
|
+
rowStyle?: CSSObject;
|
|
97
|
+
selectedRow?: string;
|
|
98
|
+
selectedRowStyle?: CSSObject;
|
|
99
|
+
hoveredRow?: string;
|
|
100
|
+
hoveredRowStyle?: CSSObject;
|
|
101
|
+
cell?: string;
|
|
102
|
+
cellStyle?: CSSObject;
|
|
103
|
+
selectedCell?: string;
|
|
104
|
+
selectedCellStyle?: CSSObject;
|
|
105
|
+
pagination?: string;
|
|
106
|
+
paginationStyle?: CSSObject;
|
|
107
|
+
paginationButton?: string;
|
|
108
|
+
paginationButtonStyle?: CSSObject;
|
|
109
|
+
pageInfo?: string;
|
|
110
|
+
pageInfoStyle?: CSSObject;
|
|
111
|
+
emptyState?: string;
|
|
112
|
+
emptyStateStyle?: CSSObject;
|
|
113
|
+
loadingState?: string;
|
|
114
|
+
loadingStateStyle?: CSSObject;
|
|
115
|
+
toolbar?: string;
|
|
116
|
+
toolbarStyle?: CSSObject;
|
|
117
|
+
columnManager?: string;
|
|
118
|
+
columnManagerStyle?: CSSObject;
|
|
119
|
+
columnManagerTrigger?: string;
|
|
120
|
+
columnManagerTriggerStyle?: CSSObject;
|
|
121
|
+
columnManagerContent?: string;
|
|
122
|
+
columnManagerContentStyle?: CSSObject;
|
|
123
|
+
columnManagerItem?: string;
|
|
124
|
+
columnManagerItemStyle?: CSSObject;
|
|
125
|
+
groupManager?: string;
|
|
126
|
+
groupManagerStyle?: CSSObject;
|
|
127
|
+
groupManagerTrigger?: string;
|
|
128
|
+
groupManagerTriggerStyle?: CSSObject;
|
|
129
|
+
groupManagerContent?: string;
|
|
130
|
+
groupManagerContentStyle?: CSSObject;
|
|
131
|
+
groupManagerItem?: string;
|
|
132
|
+
groupManagerItemStyle?: CSSObject;
|
|
133
|
+
filterMenu?: string;
|
|
134
|
+
filterMenuStyle?: CSSObject;
|
|
135
|
+
filterMenuHeader?: string;
|
|
136
|
+
filterMenuHeaderStyle?: CSSObject;
|
|
137
|
+
filterMenuInput?: string;
|
|
138
|
+
filterMenuInputStyle?: CSSObject;
|
|
139
|
+
filterMenuActions?: string;
|
|
140
|
+
filterMenuActionsStyle?: CSSObject;
|
|
141
|
+
columnMenu?: string;
|
|
142
|
+
columnMenuStyle?: CSSObject;
|
|
143
|
+
columnMenuTrigger?: string;
|
|
144
|
+
columnMenuTriggerStyle?: CSSObject;
|
|
145
|
+
columnMenuItem?: string;
|
|
146
|
+
columnMenuItemStyle?: CSSObject;
|
|
147
|
+
resizeHandle?: string;
|
|
148
|
+
resizeHandleStyle?: CSSObject;
|
|
149
|
+
resizeHandleActive?: string;
|
|
150
|
+
resizeHandleActiveStyle?: CSSObject;
|
|
151
|
+
sortIcon?: string;
|
|
152
|
+
sortIconStyle?: CSSObject;
|
|
153
|
+
sortIconActive?: string;
|
|
154
|
+
sortIconActiveStyle?: CSSObject;
|
|
155
|
+
filterIcon?: string;
|
|
156
|
+
filterIconStyle?: CSSObject;
|
|
157
|
+
filterIconActive?: string;
|
|
158
|
+
filterIconActiveStyle?: CSSObject;
|
|
159
|
+
}
|
|
160
|
+
export interface VirtualizedGridProps<T = any> {
|
|
161
|
+
columns: ColumnDef<T>[];
|
|
162
|
+
data: T[];
|
|
163
|
+
pagination?: {
|
|
164
|
+
pageIndex: number;
|
|
165
|
+
pageSize: number;
|
|
166
|
+
totalRows: number;
|
|
167
|
+
onPageChange?: (page: number) => void;
|
|
168
|
+
onPageSizeChange?: (size: number) => void;
|
|
169
|
+
pageSizeOptions?: number[];
|
|
170
|
+
manualPagination?: boolean;
|
|
171
|
+
};
|
|
172
|
+
virtualizationThreshold?: number;
|
|
173
|
+
rowHeight?: number;
|
|
174
|
+
overscan?: number;
|
|
175
|
+
sortState?: SortState | null;
|
|
176
|
+
onSortChange?: (sortState: SortState | null) => void;
|
|
177
|
+
enableSorting?: boolean;
|
|
178
|
+
sortIconVariant?: 'arrows' | 'chevrons';
|
|
179
|
+
filterState?: FilterState;
|
|
180
|
+
onFilterChange?: (filterState: FilterState) => void;
|
|
181
|
+
enableFiltering?: boolean;
|
|
182
|
+
renderFilterMenu?: (props: FilterMenuRenderProps) => ReactNode;
|
|
183
|
+
selectedRows?: RowSelectionState;
|
|
184
|
+
onRowSelectionChange?: (selectedRows: RowSelectionState) => void;
|
|
185
|
+
enableRowSelection?: boolean;
|
|
186
|
+
enableCellSelection?: boolean;
|
|
187
|
+
selectedCell?: {
|
|
188
|
+
rowId: string;
|
|
189
|
+
columnId: string;
|
|
190
|
+
} | null;
|
|
191
|
+
onCellSelect?: (rowId: string, columnId: string) => void;
|
|
192
|
+
enableColumnResize?: boolean;
|
|
193
|
+
columnWidths?: Record<string, number>;
|
|
194
|
+
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
195
|
+
enableColumnReorder?: boolean;
|
|
196
|
+
columnOrder?: string[];
|
|
197
|
+
onColumnOrderChange?: (order: string[]) => void;
|
|
198
|
+
enableColumnMenu?: boolean;
|
|
199
|
+
defaultColumnMenuItems?: ColumnMenuItem[];
|
|
200
|
+
onColumnAction?: (action: string, columnId: string) => void;
|
|
201
|
+
renderColumnMenu?: (props: ColumnMenuRenderProps) => ReactNode;
|
|
202
|
+
renderColumnMenuTrigger?: (props: {
|
|
203
|
+
column: ColumnDef;
|
|
204
|
+
onClick: () => void;
|
|
205
|
+
}) => ReactNode;
|
|
206
|
+
enableGrouping?: boolean;
|
|
207
|
+
groupingState?: GroupingState;
|
|
208
|
+
onGroupingChange?: (groupingState: GroupingState) => void;
|
|
209
|
+
renderGroupRow?: (props: GroupRowRenderProps) => ReactNode;
|
|
210
|
+
enableExpandableRows?: boolean;
|
|
211
|
+
expandedRows?: Record<string, boolean>;
|
|
212
|
+
onExpandedRowsChange?: (expandedRows: Record<string, boolean>) => void;
|
|
213
|
+
renderExpandedRow?: (row: T) => ReactNode;
|
|
214
|
+
isLoading?: boolean;
|
|
215
|
+
emptyMessage?: string;
|
|
216
|
+
loadingMessage?: string;
|
|
217
|
+
className?: string;
|
|
218
|
+
classes?: GridClasses;
|
|
219
|
+
renderCell?: (props: {
|
|
220
|
+
value: any;
|
|
221
|
+
row: T;
|
|
222
|
+
column: ColumnDef<T>;
|
|
223
|
+
rowIndex: number;
|
|
224
|
+
}) => ReactNode;
|
|
225
|
+
renderRow?: (props: {
|
|
226
|
+
row: T;
|
|
227
|
+
rowIndex: number;
|
|
228
|
+
cells: ReactNode[];
|
|
229
|
+
defaultRow: ReactNode;
|
|
230
|
+
}) => ReactNode;
|
|
231
|
+
renderHeaderCell?: (props: {
|
|
232
|
+
column: ColumnDef<T>;
|
|
233
|
+
columnIndex: number;
|
|
234
|
+
sortDirection?: SortDirection;
|
|
235
|
+
defaultHeader: ReactNode;
|
|
236
|
+
}) => ReactNode;
|
|
237
|
+
renderHeader?: (props: {
|
|
238
|
+
column: ColumnDef<T>;
|
|
239
|
+
sortDirection?: SortDirection;
|
|
240
|
+
}) => ReactNode;
|
|
241
|
+
renderSortIcon?: (props: {
|
|
242
|
+
isSorted: boolean;
|
|
243
|
+
sortDirection?: SortDirection;
|
|
244
|
+
}) => ReactNode;
|
|
245
|
+
renderFilterIcon?: (props: {
|
|
246
|
+
isFiltered: boolean;
|
|
247
|
+
}) => ReactNode;
|
|
248
|
+
onRowClick?: (row: T, index: number, event: React.MouseEvent<HTMLDivElement>) => void;
|
|
249
|
+
onRowMouseDown?: (row: T, index: number, event: React.MouseEvent<HTMLDivElement>) => void;
|
|
250
|
+
onRowMouseEnter?: (row: T, index: number, event: React.MouseEvent<HTMLDivElement>) => void;
|
|
251
|
+
getRowId?: (row: T) => string;
|
|
252
|
+
onScroll?: (event: {
|
|
253
|
+
scrollTop: number;
|
|
254
|
+
scrollHeight: number;
|
|
255
|
+
clientHeight: number;
|
|
256
|
+
scrollPercentage: number;
|
|
257
|
+
}) => void;
|
|
258
|
+
contextMenuContent?: (row: T, column: ColumnDef<T>) => ReactNode;
|
|
259
|
+
gridId?: string;
|
|
260
|
+
hideColumnManager?: boolean;
|
|
261
|
+
hideGroupControls?: boolean;
|
|
262
|
+
}
|
|
263
|
+
export interface GroupRowRenderProps {
|
|
264
|
+
groupKey: string;
|
|
265
|
+
columnId: string;
|
|
266
|
+
value: any;
|
|
267
|
+
depth: number;
|
|
268
|
+
isExpanded: boolean;
|
|
269
|
+
onToggleExpand: () => void;
|
|
270
|
+
count: number;
|
|
271
|
+
}
|
|
272
|
+
export interface GridPreferences {
|
|
273
|
+
columnWidths: Record<string, number>;
|
|
274
|
+
columnOrder: string[];
|
|
275
|
+
hiddenColumns: string[];
|
|
276
|
+
groupByColumns: string[];
|
|
277
|
+
expandedGroups: Record<string, boolean>;
|
|
278
|
+
}
|