react-kd-grid 1.1.1 → 1.2.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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/dist/workers/CustomGrid.d.ts +0 -3
  3. package/dist/workers/components/ColumnFilterSelector.d.ts +0 -18
  4. package/dist/workers/components/CustomSelect.d.ts +0 -14
  5. package/dist/workers/components/FooterAggregate.d.ts +0 -16
  6. package/dist/workers/components/GridHeader.d.ts +0 -33
  7. package/dist/workers/components/GridRows.d.ts +0 -49
  8. package/dist/workers/components/GroupBar.d.ts +0 -12
  9. package/dist/workers/components/GroupHeader.d.ts +0 -29
  10. package/dist/workers/components/NoDataMessage.d.ts +0 -7
  11. package/dist/workers/components/PaginationControls.d.ts +0 -15
  12. package/dist/workers/components/Popover.d.ts +0 -17
  13. package/dist/workers/components/RowContextMenu.d.ts +0 -22
  14. package/dist/workers/components/SearchToolbar.d.ts +0 -79
  15. package/dist/workers/components/filters/BooleanFilter.d.ts +0 -7
  16. package/dist/workers/components/filters/DateFilter.d.ts +0 -9
  17. package/dist/workers/components/filters/FilterContent.d.ts +0 -9
  18. package/dist/workers/components/filters/FilterPopup.d.ts +0 -2
  19. package/dist/workers/components/filters/MultiselectFilter.d.ts +0 -10
  20. package/dist/workers/components/filters/NumberFilter.d.ts +0 -9
  21. package/dist/workers/components/filters/TextFilter.d.ts +0 -8
  22. package/dist/workers/components/filters/index.d.ts +0 -6
  23. package/dist/workers/components/ui/DatePicker.d.ts +0 -10
  24. package/dist/workers/constants.d.ts +0 -1
  25. package/dist/workers/dataWorker.js +0 -2
  26. package/dist/workers/dataWorker.js.map +0 -1
  27. package/dist/workers/hooks/useAdvancedFiltering.d.ts +0 -16
  28. package/dist/workers/hooks/useDataWorker.d.ts +0 -10
  29. package/dist/workers/hooks/useExport.d.ts +0 -15
  30. package/dist/workers/hooks/useFilteringAndSorting.d.ts +0 -16
  31. package/dist/workers/hooks/useGrouping.d.ts +0 -28
  32. package/dist/workers/hooks/usePagination.d.ts +0 -28
  33. package/dist/workers/hooks/useSelection.d.ts +0 -13
  34. package/dist/workers/hooks/useVirtualization.d.ts +0 -17
  35. package/dist/workers/index.d.ts +0 -11
  36. package/dist/workers/types.d.ts +0 -421
  37. package/dist/workers/utils/highlightText.d.ts +0 -15
  38. package/dist/workers/workers/dataWorker.d.ts +0 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-kd-grid",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "A feature-rich, performant React data grid component with virtualization, grouping, filtering, and export capabilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,3 +0,0 @@
1
- import { CustomDataGridProps, CustomDataGridRef } from "./types";
2
- export declare const CustomDataGrid: import("react").ForwardRefExoticComponent<CustomDataGridProps & import("react").RefAttributes<CustomDataGridRef>>;
3
- export default CustomDataGrid;
@@ -1,18 +0,0 @@
1
- interface ColumnFilterSelectorProps {
2
- columns: Array<{
3
- key: string;
4
- header: string;
5
- filterable?: {
6
- type?: string;
7
- options?: Array<{
8
- label: string;
9
- value: string | number;
10
- }>;
11
- placeholder?: string;
12
- };
13
- }>;
14
- columnFilters: Record<string, any>;
15
- onColumnFilter?: (columnKey: string, filter: any) => void;
16
- }
17
- export declare const ColumnFilterSelector: ({ columns, columnFilters, onColumnFilter, }: ColumnFilterSelectorProps) => import("react/jsx-runtime").JSX.Element;
18
- export {};
@@ -1,14 +0,0 @@
1
- interface Option {
2
- label: string;
3
- value: string;
4
- }
5
- interface CustomSelectProps {
6
- options: Option[];
7
- value?: string;
8
- placeholder?: string;
9
- onChange: (value: string) => void;
10
- searchable?: boolean;
11
- className?: string;
12
- }
13
- export declare const CustomSelect: ({ options, value, placeholder, onChange, searchable, className, }: CustomSelectProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { GridColumn, GridRow } from "../types";
3
- interface FooterAggregateProps {
4
- columns: (GridColumn & {
5
- width: number;
6
- })[];
7
- data: GridRow[];
8
- selectable: boolean;
9
- /** Resolved row height so footer matches density */
10
- rowHeight: number;
11
- /** Pinned columns (same semantics as grid body) */
12
- pinnedColumns?: Set<string>;
13
- getRowId?: (row: GridRow) => string | number;
14
- }
15
- export declare const FooterAggregate: React.NamedExoticComponent<FooterAggregateProps>;
16
- export {};
@@ -1,33 +0,0 @@
1
- import { GridColumn, SortConfig, ActiveFilters, ColumnFilterValue, GridRow } from "../types";
2
- interface GridHeaderProps {
3
- pinnedColumns: GridColumn[];
4
- unpinnedColumns: GridColumn[];
5
- hvPadLeft?: number;
6
- hvPadRight?: number;
7
- headerHeight: number;
8
- sortConfig: SortConfig;
9
- columnFilters: ActiveFilters;
10
- selectable: boolean;
11
- selectedRows: Set<string | number>;
12
- totalRows: number;
13
- data: GridRow[];
14
- onSort: (key: string) => void;
15
- onColumnFilter: (key: string, filter: ColumnFilterValue | null) => void;
16
- onSelectAll: () => void;
17
- onColumnResize?: (columnKey: string, width: number) => void;
18
- pinnedKeySet?: Set<string>;
19
- onColumnPin?: (columnKey: string, pinned: boolean) => void;
20
- groupable?: boolean;
21
- groupedByColumn?: string | null;
22
- onGroupBy?: (columnKey: string | null) => void;
23
- groupedByColumns?: string[];
24
- onGroupToggle?: (columnKey: string, nextGrouped: boolean) => void;
25
- onAutosizeColumn?: (columnKey: string) => void;
26
- onAutosizeAllColumns?: () => void;
27
- onResetColumns?: () => void;
28
- columnOrder: string[];
29
- onColumnOrderChange: (order: string[]) => void;
30
- paginationMode?: "client" | "server" | null;
31
- }
32
- export declare const GridHeader: ({ pinnedColumns, unpinnedColumns, hvPadLeft, hvPadRight, headerHeight, sortConfig, columnFilters, selectable, selectedRows, totalRows, data, onSort, onColumnFilter, onSelectAll, onColumnResize, pinnedKeySet, onColumnPin, groupable, groupedByColumn, onGroupBy, groupedByColumns, onGroupToggle, onAutosizeColumn, onAutosizeAllColumns, onResetColumns, columnOrder, onColumnOrderChange, paginationMode, }: GridHeaderProps) => import("react/jsx-runtime").JSX.Element;
33
- export {};
@@ -1,49 +0,0 @@
1
- import { CSSProperties, MouseEvent } from "react";
2
- import { GridRow, GridColumn, VirtualizedRange } from "../types";
3
- interface GridRowsProps {
4
- data: GridRow[];
5
- columns: GridColumn[];
6
- selectedRows: Set<string | number>;
7
- virtualized: boolean;
8
- virtualizedRange: VirtualizedRange;
9
- rowHeight: number;
10
- selectable: boolean;
11
- isRowSelectable?: (row: GridRow) => boolean;
12
- onRowSelect: (rowId: string | number, isSelected: boolean) => void;
13
- pinnedColumns?: Set<string>;
14
- hvPadLeft?: number;
15
- hvPadRight?: number;
16
- rowStyle?: (row: GridRow) => CSSProperties | undefined;
17
- globalFilter?: string;
18
- onContextMenu?: (row: GridRow, event: MouseEvent) => void;
19
- onRowDoubleClick?: (row: GridRow, event: MouseEvent) => void;
20
- onRowClick?: (row: GridRow, event: MouseEvent) => void;
21
- onCellClick?: (args: {
22
- row: GridRow;
23
- column: GridColumn;
24
- value: any;
25
- event: MouseEvent;
26
- }) => void;
27
- isCellFocused?: (rowId: string | number, columnKey: string) => boolean;
28
- isCellSelected?: (rowId: string | number, columnKey: string) => boolean;
29
- onCellContextMenu?: (args: {
30
- row: GridRow;
31
- column: GridColumn;
32
- value: any;
33
- displayValue: string;
34
- event: MouseEvent;
35
- }) => void;
36
- onCellMouseDown?: (args: {
37
- row: GridRow;
38
- column: GridColumn;
39
- event: MouseEvent;
40
- }) => void;
41
- onCellMouseEnter?: (args: {
42
- row: GridRow;
43
- column: GridColumn;
44
- event: MouseEvent;
45
- }) => void;
46
- getRowId?: (row: GridRow) => string | number;
47
- }
48
- export declare const GridRows: import("react").MemoExoticComponent<({ 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>;
49
- export {};
@@ -1,12 +0,0 @@
1
- import type { GridColumn } from "../types";
2
- interface GroupBarProps {
3
- columns: GridColumn[];
4
- groupedKeys: string[];
5
- onRemove: (columnKey: string) => void;
6
- onReorder: (newOrder: string[]) => void;
7
- onDropColumnKey: (columnKey: string) => void;
8
- onToggleExpandAll?: () => void;
9
- isAnyExpanded?: boolean;
10
- }
11
- export declare const GroupBar: ({ columns, groupedKeys, onRemove, onReorder, onDropColumnKey, onToggleExpandAll, isAnyExpanded, }: GroupBarProps) => import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,29 +0,0 @@
1
- import { GridRow, CustomDataGridProps } from "../types";
2
- interface GroupHeaderProps {
3
- row: GridRow & {
4
- _isGroupHeader?: boolean;
5
- _groupKey?: string;
6
- _groupCount?: number;
7
- };
8
- isExpanded: boolean;
9
- onToggle: (groupKey: string) => void;
10
- viewportWidth: number;
11
- selectable: boolean;
12
- rowHeight?: number;
13
- /**
14
- * Optional function to map a column key to its display label (header).
15
- * If not provided, the raw column key will be used as a fallback.
16
- */
17
- getHeaderLabel?: (columnKey: string) => string;
18
- /**
19
- * Optional function to map a column key and raw group value to a display label.
20
- * Useful to apply the column's formatter for group headers.
21
- */
22
- getValueLabel?: (columnKey: string, rawValue: any) => string;
23
- /**
24
- * Optional custom renderer for actions on grouped rows.
25
- */
26
- renderGroupActions?: CustomDataGridProps["renderGroupActions"];
27
- }
28
- export declare const GroupHeader: import("react").MemoExoticComponent<({ row, isExpanded, onToggle, viewportWidth, selectable, rowHeight, getHeaderLabel, getValueLabel, renderGroupActions, }: GroupHeaderProps) => import("react/jsx-runtime").JSX.Element>;
29
- export {};
@@ -1,7 +0,0 @@
1
- interface NoDataMessageProps {
2
- hasFilters?: boolean;
3
- hasData?: boolean;
4
- message?: string;
5
- }
6
- export declare const NoDataMessage: ({ hasFilters, hasData, message, }: NoDataMessageProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,15 +0,0 @@
1
- import { PaginationConfig } from "../types";
2
- interface PaginationControlsProps {
3
- paginationConfig: PaginationConfig;
4
- currentPage: number;
5
- isServerLoading: boolean;
6
- selectedRowsCount: number;
7
- totalDataLength: number;
8
- filteredDataLength?: number;
9
- paginationMode?: "client" | "server";
10
- onPageChange: (page: number, pageSize: number) => void;
11
- onPageSizeChange: (pageSize: number) => void;
12
- showNoDataMessage?: boolean;
13
- }
14
- export declare const PaginationControls: ({ paginationConfig, currentPage, isServerLoading, selectedRowsCount, totalDataLength, filteredDataLength, paginationMode, onPageChange, onPageSizeChange, }: PaginationControlsProps) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import { type Placement } from "@floating-ui/react";
3
- interface PopoverProps {
4
- open: boolean;
5
- anchorEl: HTMLElement | null;
6
- onClose: () => void;
7
- placement?: Placement;
8
- offset?: number;
9
- sameWidth?: boolean;
10
- maxHeight?: number | string;
11
- zIndex?: number;
12
- className?: string;
13
- children: React.ReactNode;
14
- shouldIgnoreClose?: (target: Node) => boolean;
15
- }
16
- export declare const Popover: React.FC<PopoverProps>;
17
- export default Popover;
@@ -1,22 +0,0 @@
1
- import { ReactNode } from "react";
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
- }
11
- interface RowContextMenuProps {
12
- row: GridRow;
13
- position: {
14
- x: number;
15
- y: number;
16
- };
17
- isVisible: boolean;
18
- onClose: () => void;
19
- menuItems?: ContextMenuItem[];
20
- }
21
- export declare const RowContextMenu: ({ row, position, isVisible, onClose, menuItems, }: RowContextMenuProps) => import("react/jsx-runtime").JSX.Element;
22
- export {};
@@ -1,79 +0,0 @@
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
- }
13
- interface ColumnVisibility {
14
- [columnKey: string]: boolean;
15
- }
16
- interface SavedFilter {
17
- id: string;
18
- name: string;
19
- globalFilter: string;
20
- columnFilters: Record<string, any>;
21
- }
22
- interface SearchToolbarProps {
23
- globalFilter: string;
24
- filteredDataLength: number;
25
- totalDataLength: number;
26
- paginationMode?: "client" | "server";
27
- totalRows?: number;
28
- selectedRowsCount?: number;
29
- selectedRows?: Set<string | number>;
30
- showExport?: boolean;
31
- showRefresh?: boolean;
32
- showColumnToggle?: boolean;
33
- showBulkActions?: boolean;
34
- showSavedFilters?: boolean;
35
- columns?: Array<{
36
- key: string;
37
- header: string;
38
- visible?: boolean;
39
- filterOptions?: Array<{
40
- label: string;
41
- value: string | number;
42
- }>;
43
- filterType?: "text" | "select" | "multiselect";
44
- filterable?: any;
45
- }>;
46
- columnVisibility?: ColumnVisibility;
47
- columnFilters?: Record<string, any>;
48
- savedFilters?: SavedFilter[];
49
- bulkActions?: BulkActionOption[];
50
- isLoading?: boolean;
51
- exportOptions?: {
52
- enabled: boolean;
53
- formats?: ExportFormat[];
54
- filename?: string;
55
- onExport?: (format: ExportFormat, exportSelected: boolean) => void;
56
- };
57
- onGlobalFilterChange: (e: ChangeEvent<HTMLInputElement>) => void;
58
- onClearFilters?: () => void;
59
- onRefresh?: () => void;
60
- onColumnVisibilityChange?: (columnKey: string, visible: boolean) => void;
61
- onColumnFilter?: (columnKey: string, filter: any) => void;
62
- onSaveFilter?: (filter: Omit<SavedFilter, "id">) => void;
63
- onLoadFilter?: (filter: SavedFilter) => void;
64
- onDeleteFilter?: (filterId: string) => void;
65
- onRowSelect?: (selectedRows: number[]) => void;
66
- onToggleFilters?: (show: boolean) => void;
67
- onResetColumns?: () => void;
68
- columnOrder?: string[];
69
- onColumnOrderChange?: (order: string[]) => void;
70
- pinnedColumns?: Set<string>;
71
- onScrollToColumn?: (columnKey: string) => void;
72
- density?: Density;
73
- onDensityChange?: (density: Density) => void;
74
- showDensityControl?: boolean;
75
- customLeftContent?: ReactNode;
76
- customRightContent?: ReactNode;
77
- }
78
- export declare const SearchToolbar: ({ globalFilter, filteredDataLength, selectedRowsCount, selectedRows, showExport, showColumnToggle, showBulkActions, columns, columnVisibility, columnFilters, bulkActions, exportOptions, onGlobalFilterChange, onClearFilters, onColumnVisibilityChange, onColumnFilter, onResetColumns, columnOrder, onColumnOrderChange, pinnedColumns, onScrollToColumn, density, onDensityChange, showDensityControl, customLeftContent, customRightContent, }: SearchToolbarProps) => import("react/jsx-runtime").JSX.Element;
79
- export {};
@@ -1,7 +0,0 @@
1
- import { ColumnFilterValue } from "../../types";
2
- interface BooleanFilterProps {
3
- value: ColumnFilterValue | null;
4
- onChange: (value: ColumnFilterValue | null) => void;
5
- }
6
- export declare const BooleanFilter: ({ value, onChange }: BooleanFilterProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,9 +0,0 @@
1
- import { ColumnFilterValue } from "../../types";
2
- interface DateFilterProps {
3
- value: ColumnFilterValue | null;
4
- onChange: (value: ColumnFilterValue | null) => void;
5
- min?: number;
6
- max?: number;
7
- }
8
- export declare const DateFilter: ({ value, onChange, min, max }: DateFilterProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,9 +0,0 @@
1
- import { ColumnFilterValue, GridColumn, GridRow } from "../../types";
2
- interface FilterContentProps {
3
- column: GridColumn;
4
- data: GridRow[];
5
- value: ColumnFilterValue | null;
6
- onChange: (val: ColumnFilterValue | null) => void;
7
- }
8
- export declare const FilterContent: ({ column, data, value, onChange }: FilterContentProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,2 +0,0 @@
1
- import { FilterPopupProps } from "../../types";
2
- export declare const FilterPopup: ({ column, data, currentFilter, onApplyFilter, onClose, position, autoApply, }: FilterPopupProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { ColumnFilterValue, FilterOption, GridRow } from "../../types";
2
- interface MultiselectFilterProps {
3
- value: ColumnFilterValue | null;
4
- onChange: (value: ColumnFilterValue | null) => void;
5
- options?: FilterOption[];
6
- data: GridRow[];
7
- columnKey: string;
8
- }
9
- export declare const MultiselectFilter: ({ value, onChange, options, data, columnKey, }: MultiselectFilterProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,9 +0,0 @@
1
- import { ColumnFilterValue } from "../../types";
2
- interface NumberFilterProps {
3
- value: ColumnFilterValue | null;
4
- onChange: (value: ColumnFilterValue | null) => void;
5
- min?: number;
6
- max?: number;
7
- }
8
- export declare const NumberFilter: ({ value, onChange, min, max, }: NumberFilterProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,8 +0,0 @@
1
- import { ColumnFilterValue } from "../../types";
2
- interface TextFilterProps {
3
- value: ColumnFilterValue | null;
4
- onChange: (value: ColumnFilterValue | null) => void;
5
- placeholder?: string;
6
- }
7
- export declare const TextFilter: ({ value, onChange, placeholder, }: TextFilterProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,6 +0,0 @@
1
- export { TextFilter } from './TextFilter';
2
- export { NumberFilter } from './NumberFilter';
3
- export { DateFilter } from './DateFilter';
4
- export { MultiselectFilter } from './MultiselectFilter';
5
- export { BooleanFilter } from './BooleanFilter';
6
- export { FilterPopup } from './FilterPopup';
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- interface DatePickerProps {
3
- name?: string;
4
- label?: string;
5
- value: string | null;
6
- onChange: (value: string | null) => void;
7
- className?: string;
8
- }
9
- export declare const DatePicker: React.FC<DatePickerProps>;
10
- export {};
@@ -1 +0,0 @@
1
- export declare const SELECT_COL_WIDTH = 48;
@@ -1,2 +0,0 @@
1
- const t=self;t.onmessage=e=>{const r=e.data;if(r&&"process"===r.type)try{const{rows:e,sort:s}=r.payload,n=((t,e)=>{if(!t||0===t.length)return t;let r=t;if(e&&e.key){const{key:s,direction:n}=e,o="asc"===n?1:-1;r=[...t].sort((t,e)=>{const r=t?.[s],n=e?.[s];if(null==r&&null==n)return 0;if(null==r)return-1*o;if(null==n)return 1*o;if("number"==typeof r&&"number"==typeof n)return(r-n)*o;const l=String(r),a=String(n);return l.localeCompare(a)*o})}return r})(e,s??null),o={type:"result",payload:{rows:n}};t.postMessage(o)}catch(e){const s={type:"result",payload:{rows:r.payload.rows}};t.postMessage(s)}};
2
- //# sourceMappingURL=dataWorker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataWorker.js","sources":["../../../workers/dataWorker.ts"],"sourcesContent":["// Web Worker for heavy data processing (sorting for now)\n// Message protocol\n// { type: 'process', payload: { rows: any[], sort?: { key: string; direction: 'asc' | 'desc' } } }\n// Response: { type: 'result', payload: { rows: any[] } }\n\nexport interface WorkerProcessMessage {\n type: \"process\";\n payload: {\n rows: any[];\n sort?: { key: string; direction: \"asc\" | \"desc\" } | null;\n };\n}\n\nexport interface WorkerResultMessage {\n type: \"result\";\n payload: { rows: any[] };\n}\n\nconst ctx: any = self as any;\n\nconst processData = (\n rows: any[],\n sort?: { key: string; direction: \"asc\" | \"desc\" } | null\n) => {\n if (!rows || rows.length === 0) return rows;\n let out = rows;\n if (sort && sort.key) {\n const { key, direction } = sort;\n const dir = direction === \"asc\" ? 1 : -1;\n out = [...rows].sort((a, b) => {\n const av = a?.[key];\n const bv = b?.[key];\n if (av == null && bv == null) return 0;\n if (av == null) return -1 * dir;\n if (bv == null) return 1 * dir;\n if (typeof av === \"number\" && typeof bv === \"number\")\n return (av - bv) * dir;\n const as = String(av);\n const bs = String(bv);\n return as.localeCompare(bs) * dir;\n });\n }\n return out;\n};\n\nctx.onmessage = (e: MessageEvent<WorkerProcessMessage>) => {\n const msg = e.data;\n if (!msg || msg.type !== \"process\") return;\n try {\n const { rows, sort } = msg.payload;\n const result = processData(rows, sort ?? null);\n const response: WorkerResultMessage = {\n type: \"result\",\n payload: { rows: result },\n };\n ctx.postMessage(response);\n } catch (err) {\n // In case of unexpected errors, return original rows to avoid blocking UI\n const response: WorkerResultMessage = {\n type: \"result\",\n payload: { rows: msg.payload.rows },\n };\n ctx.postMessage(response);\n }\n};\n"],"names":["ctx","self","onmessage","e","msg","data","type","rows","sort","payload","result","length","out","key","direction","dir","a","b","av","bv","as","String","bs","localeCompare","processData","response","postMessage","err"],"mappings":"AAkBA,MAAMA,EAAWC,KA2BjBD,EAAIE,UAAaC,IACf,MAAMC,EAAMD,EAAEE,KACd,GAAKD,GAAoB,YAAbA,EAAIE,KAChB,IACE,MAAMC,KAAEA,EAAIC,KAAEA,GAASJ,EAAIK,QACrBC,EA9BU,EAClBH,EACAC,KAEA,IAAKD,GAAwB,IAAhBA,EAAKI,OAAc,OAAOJ,EACvC,IAAIK,EAAML,EACV,GAAIC,GAAQA,EAAKK,IAAK,CACpB,MAAMA,IAAEA,EAAGC,UAAEA,GAAcN,EACrBO,EAAoB,QAAdD,EAAsB,GAAK,EACvCF,EAAM,IAAIL,GAAMC,KAAK,CAACQ,EAAGC,KACvB,MAAMC,EAAKF,IAAIH,GACTM,EAAKF,IAAIJ,GACf,GAAU,MAANK,GAAoB,MAANC,EAAY,OAAO,EACrC,GAAU,MAAND,EAAY,OAAQ,EAAIH,EAC5B,GAAU,MAANI,EAAY,OAAO,EAAIJ,EAC3B,GAAkB,iBAAPG,GAAiC,iBAAPC,EACnC,OAAQD,EAAKC,GAAMJ,EACrB,MAAMK,EAAKC,OAAOH,GACZI,EAAKD,OAAOF,GAClB,OAAOC,EAAGG,cAAcD,GAAMP,GAEjC,CACD,OAAOH,GAQUY,CAAYjB,EAAMC,GAAQ,MACnCiB,EAAgC,CACpCnB,KAAM,SACNG,QAAS,CAAEF,KAAMG,IAEnBV,EAAI0B,YAAYD,EACjB,CAAC,MAAOE,GAEP,MAAMF,EAAgC,CACpCnB,KAAM,SACNG,QAAS,CAAEF,KAAMH,EAAIK,QAAQF,OAE/BP,EAAI0B,YAAYD,EACjB"}
@@ -1,16 +0,0 @@
1
- import { GridRow, GridColumn, ActiveFilters, ColumnFilterValue } from "../types";
2
- interface UseAdvancedFilteringProps {
3
- data: GridRow[];
4
- columns: GridColumn[];
5
- }
6
- export declare const useAdvancedFiltering: ({ data, columns, }: UseAdvancedFilteringProps) => {
7
- globalFilter: string;
8
- setGlobalFilter: import("react").Dispatch<import("react").SetStateAction<string>>;
9
- columnFilters: ActiveFilters;
10
- filteredData: GridRow[];
11
- setColumnFilter: (columnKey: string, filter: ColumnFilterValue | null) => void;
12
- clearColumnFilter: (columnKey: string) => void;
13
- clearAllFilters: () => void;
14
- getActiveFilterCount: () => number;
15
- };
16
- export {};
@@ -1,10 +0,0 @@
1
- type SortCfg = {
2
- key: string;
3
- direction: "asc" | "desc";
4
- } | null;
5
- export declare function useDataWorker(options?: {
6
- enabled?: boolean;
7
- }): {
8
- process: (rows: any[], sort: SortCfg) => Promise<any[]>;
9
- };
10
- export {};
@@ -1,15 +0,0 @@
1
- import { GridRow, GridColumn } from "../types";
2
- export type ExportFormat = "csv" | "json" | "xlsx";
3
- interface UseExportProps {
4
- data: GridRow[];
5
- columns: GridColumn[];
6
- selectedRows?: Set<string | number>;
7
- filename?: string;
8
- columnVisibility?: Record<string, boolean>;
9
- }
10
- export declare const useExport: ({ data, columns, selectedRows, filename, columnVisibility, }: UseExportProps) => {
11
- exportData: (format: ExportFormat, exportSelected?: boolean) => void;
12
- canExportSelected: boolean;
13
- selectedCount: number;
14
- };
15
- export {};
@@ -1,16 +0,0 @@
1
- import { ChangeEvent } from "react";
2
- import { SortConfig, GridRow, GridColumn } from "../types";
3
- interface UseFilteringAndSortingProps {
4
- data: GridRow[];
5
- columns: GridColumn[];
6
- }
7
- export declare const useFilteringAndSorting: ({ data, columns, }: UseFilteringAndSortingProps) => {
8
- sortConfig: SortConfig;
9
- filters: Record<string, string>;
10
- globalFilter: string;
11
- filteredData: GridRow[];
12
- handleSort: (key: string) => void;
13
- handleFilter: (key: string, value: string) => void;
14
- handleGlobalFilterChange: (e: ChangeEvent<HTMLInputElement>) => void;
15
- };
16
- export {};
@@ -1,28 +0,0 @@
1
- import { GridRow, GroupConfig, GridColumn } from "../types";
2
- interface UseGroupingProps {
3
- data: GridRow[];
4
- columns: GridColumn[];
5
- }
6
- export declare const useGrouping: ({ data, columns }: UseGroupingProps) => {
7
- groupConfig: GroupConfig;
8
- displayData: (GridRow & {
9
- _isGroupHeader?: boolean;
10
- _groupKey?: string;
11
- _groupCount?: number;
12
- _groupLevel?: number;
13
- _groupColumnKey?: string;
14
- _groupValue?: string;
15
- _groupRows?: GridRow[];
16
- _isGroupFooter?: boolean;
17
- _groupAgg?: Record<string, any>;
18
- })[];
19
- handleGroupBy: (columnKey: string | null) => void;
20
- addGroupKey: (columnKey: string) => void;
21
- removeGroupKey: (columnKey: string) => void;
22
- setGroupKeys: (columnKeys: string[]) => void;
23
- toggleGroupExpansion: (groupPath: string) => void;
24
- expandAllGroups: () => void;
25
- collapseAllGroups: () => void;
26
- isGrouped: boolean;
27
- };
28
- export {};
@@ -1,28 +0,0 @@
1
- import { PaginationConfig, GridRow } from "../types";
2
- interface UsePaginationProps {
3
- data: GridRow[];
4
- pagination?: {
5
- enabled?: boolean;
6
- mode?: "client" | "server";
7
- pageSize?: number;
8
- showPageSizeSelector?: boolean;
9
- pageSizeOptions?: number[];
10
- serverConfig?: {
11
- enabled: boolean;
12
- onPageChange: (page: number, pageSize: number) => Promise<void> | void;
13
- onPageSizeChange?: (pageSize: number) => Promise<void> | void;
14
- loading?: boolean;
15
- totalRows: number;
16
- };
17
- };
18
- }
19
- export declare const usePagination: ({ data, pagination }: UsePaginationProps) => {
20
- currentPage: number;
21
- resetPage: () => void;
22
- paginationConfig: PaginationConfig;
23
- paginatedData: GridRow[];
24
- isServerLoading: boolean;
25
- handlePageChange: (page: number) => Promise<void>;
26
- handlePageSizeChange: (newPageSize: number) => Promise<void>;
27
- };
28
- export {};
@@ -1,13 +0,0 @@
1
- import { GridRow } from "../types";
2
- interface UseSelectionProps {
3
- data: GridRow[];
4
- selectedRowIds?: Iterable<string | number> | null;
5
- onRowSelect?: (row: GridRow) => void;
6
- getRowId?: (row: GridRow) => string | number;
7
- }
8
- export declare const useSelection: ({ data, selectedRowIds, onRowSelect, getRowId, }: UseSelectionProps) => {
9
- selectedRows: Set<string | number>;
10
- handleRowSelect: (rowId: string | number, isSelected: boolean) => void;
11
- handleSelectAll: (isSelected: boolean) => void;
12
- };
13
- export {};
@@ -1,17 +0,0 @@
1
- import { UIEvent } from "react";
2
- import { VirtualizedRange, GridRow } from "../types";
3
- interface UseVirtualizationProps {
4
- data: GridRow[];
5
- virtualized?: boolean;
6
- rowHeight?: number;
7
- overscan?: number;
8
- height: number;
9
- }
10
- export declare const useVirtualization: ({ data, virtualized, rowHeight, overscan, height, }: UseVirtualizationProps) => {
11
- scrollRef: import("react").MutableRefObject<HTMLDivElement>;
12
- virtualizedRange: VirtualizedRange;
13
- visibleData: GridRow[];
14
- totalHeight: number;
15
- handleScroll: (e: UIEvent<HTMLDivElement>) => void;
16
- };
17
- export {};
@@ -1,11 +0,0 @@
1
- export { default as CustomDataGrid } from "./CustomGrid";
2
- export * from "./types";
3
- export { usePagination } from "./hooks/usePagination";
4
- export { useVirtualization } from "./hooks/useVirtualization";
5
- export { useFilteringAndSorting } from "./hooks/useFilteringAndSorting";
6
- export { useSelection } from "./hooks/useSelection";
7
- export { PaginationControls } from "./components/PaginationControls";
8
- export { GridHeader } from "./components/GridHeader";
9
- export { GridRows } from "./components/GridRows";
10
- export { SearchToolbar } from "./components/SearchToolbar";
11
- export { FooterAggregate } from "./components/FooterAggregate";
@@ -1,421 +0,0 @@
1
- import { CSSProperties, MouseEvent, ReactNode } from "react";
2
- export type FilterType = "text" | "multiselect" | "number" | "date" | "boolean";
3
- export type Density = "sm" | "md" | "lg";
4
- export interface FilterOption {
5
- label: string;
6
- value: any;
7
- }
8
- export interface ColumnFilter {
9
- type: FilterType;
10
- options?: FilterOption[];
11
- placeholder?: string;
12
- min?: number;
13
- max?: number;
14
- }
15
- export interface GridColumn {
16
- key: string;
17
- header: string;
18
- width?: number;
19
- /**
20
- * Flexible sizing. When true or a positive number, the column can expand to fill
21
- * available horizontal space. If a number is provided, it represents the flex grow weight.
22
- * Note: runtime support may require renderer updates; currently a type hint.
23
- */
24
- flex?: boolean | number;
25
- /** Minimum width in pixels for this column */
26
- minWidth?: number;
27
- /** Maximum width in pixels for this column */
28
- maxWidth?: number;
29
- /** Allows column to be resizable via UI (if the header implements it) */
30
- resizable?: boolean;
31
- /**
32
- * Whether the column is sortable. Defaults to true; set explicitly to false to disable.
33
- */
34
- sortable?: boolean;
35
- filterable?: boolean | ColumnFilter;
36
- formatter?: (value: any) => string;
37
- cellRenderer?: (value: any, row: GridRow) => ReactNode;
38
- visible?: boolean;
39
- /**
40
- * Group aggregate to compute for this column when grouping is enabled.
41
- * If a function is provided, it will receive the array of raw cell values and should return the aggregate value.
42
- */
43
- aggregate?: "sum" | "avg" | "min" | "max" | ((values: any[]) => any);
44
- /**
45
- * Optional formatter for the aggregate value displayed in group footers.
46
- * Falls back to the column's formatter if not provided.
47
- */
48
- aggregateFormatter?: (value: any) => string;
49
- /**
50
- * Footer aggregate to compute for this column and display at the bottom of all rows.
51
- * If a function is provided, it will receive the array of raw cell values and should return the aggregate value.
52
- */
53
- footer_aggregate?: "count" | "sum" | "avg" | "min" | "max" | ((values: any[]) => any);
54
- /**
55
- * Optional formatter for the footer aggregate value.
56
- * Falls back to the column's formatter if not provided.
57
- */
58
- footerAggregateFormatter?: (value: any) => string;
59
- /**
60
- * Horizontal alignment for cell content: left | center | right
61
- */
62
- align?: "left" | "center" | "right";
63
- /**
64
- * Horizontal alignment for header content: left | center | right
65
- */
66
- headerAlign?: "left" | "center" | "right";
67
- /** Optional CSS class for body cells of this column */
68
- className?: string | ((value: any, row: GridRow) => string);
69
- /** Optional inline style for body cells of this column */
70
- cellStyle?: CSSProperties | ((value: any, row: GridRow) => CSSProperties);
71
- /** Optional CSS class for the header cell of this column */
72
- headerClassName?: string;
73
- /** If true, removes default padding from the cell container for this column */
74
- noPadding?: boolean;
75
- /** If false, do not wrap renderer output with the default truncation div */
76
- wrapCellContent?: boolean;
77
- }
78
- export interface GridRow {
79
- id?: string | number;
80
- [key: string]: any;
81
- }
82
- export interface GroupConfig {
83
- /** Ordered list of column keys to group by (multi-level). */
84
- columnKeys: string[];
85
- /**
86
- * Expanded group paths. Each path is a stable string key built from the sequence of
87
- * grouping values, e.g. "City=SF|Status=Open". Root groups are single segment.
88
- */
89
- expanded: Set<string>;
90
- }
91
- export interface GroupedData {
92
- [groupValue: string]: {
93
- rows: GridRow[];
94
- count: number;
95
- };
96
- }
97
- export type SearchMode = "contains" | "exact" | "startsWith" | "endsWith" | "regex";
98
- export type BulkAction = "delete" | "archive" | "copy" | "edit" | "export";
99
- export interface SavedFilter {
100
- id: string;
101
- name: string;
102
- globalFilter: string;
103
- columnFilters: Record<string, any>;
104
- searchMode: SearchMode;
105
- }
106
- export interface BulkActionOption {
107
- id: BulkAction;
108
- label: string;
109
- icon: ReactNode;
110
- onClick: (selectedRows: Set<string | number>) => void;
111
- disabled?: boolean;
112
- destructive?: boolean;
113
- }
114
- export interface CustomDataGridProps {
115
- data: GridRow[];
116
- columns: GridColumn[];
117
- /**
118
- * Optional function to derive unique row identifier from a row object.
119
- * Priority order:
120
- * 1. If getRowId is provided, use it to extract the ID from the row
121
- * 2. Else if row.id exists, use it
122
- * 3. Else use the row's index as fallback (may cause issues with pagination/filtering)
123
- *
124
- * Examples:
125
- * - (row) => row.employeeId
126
- * - (row) => `${row.dept}_${row.name}` (composite key)
127
- * - (row) => row.uuid
128
- *
129
- * Recommendation: Always provide either row.id or getRowId prop for best results.
130
- */
131
- getRowId?: (row: GridRow) => string | number;
132
- height?: number;
133
- density?: Density;
134
- onDensityChange?: (density: Density) => void;
135
- /**
136
- * Optional header size controls (independent of row density).
137
- * - If headerHeight is provided, it takes precedence (fixed pixel height).
138
- * - Else if headerDensity is provided, it maps to the density sizing (sm|md|lg).
139
- * - Else defaults to medium (md).
140
- */
141
- headerDensity?: Density;
142
- headerHeight?: number;
143
- showDensityControl?: boolean;
144
- onRowSelect?: (row: GridRow) => void;
145
- onSelectedRowsChange?: (selectedRows: Set<string | number>) => void;
146
- selectable?: boolean;
147
- isRowSelectable?: (row: GridRow) => boolean;
148
- showToolbar?: boolean;
149
- showExport?: boolean;
150
- /**
151
- * Optional export options to control which formats are allowed and default filename.
152
- * If not provided, only Excel ("xlsx") will be allowed by default.
153
- */
154
- exportOptions?: {
155
- /** Allowed export formats (defaults to ["xlsx"]) */
156
- formats?: Array<"csv" | "json" | "xlsx">;
157
- /** Default exported filename without extension (defaults to "grid-data") */
158
- filename?: string;
159
- /** Enable/disable export action (defaults to true; combined with showExport) */
160
- enabled?: boolean;
161
- /** Export execution mode. Default: 'client'. */
162
- exportMode?: "client" | "server";
163
- /**
164
- * Optional handler to perform server-side export when exportMode === 'server'.
165
- * If exportSelected is true, selectedRowIds will contain the ids that are currently selected in the grid.
166
- */
167
- onServerExport?: (format: "csv" | "json" | "xlsx", exportSelected: boolean, selectedRowIds?: Array<string | number>) => void;
168
- };
169
- sortable?: boolean;
170
- filterable?: boolean;
171
- groupable?: boolean;
172
- virtualized?: boolean;
173
- rowHeight?: number;
174
- overscan?: number;
175
- rowStyle?: (row: GridRow) => CSSProperties | undefined;
176
- onContextMenu?: (row: GridRow, event: MouseEvent) => void;
177
- onRowDoubleClick?: (row: GridRow, event: MouseEvent) => void;
178
- onRowClick?: (row: GridRow, event: MouseEvent) => void;
179
- onCellClick?: (args: {
180
- row: GridRow;
181
- column: GridColumn;
182
- value: any;
183
- event: MouseEvent;
184
- }) => void;
185
- onCellContextMenu?: (args: {
186
- row: GridRow;
187
- column: GridColumn;
188
- value: any;
189
- displayValue: string;
190
- event: MouseEvent;
191
- }) => void;
192
- cellFocusEnabled?: boolean;
193
- onCellFocusChange?: (args: {
194
- row: GridRow;
195
- column: GridColumn;
196
- value: any;
197
- rowIndex: number;
198
- colIndex: number;
199
- }) => void;
200
- cellSelectionEnabled?: boolean;
201
- canSelectCell?: (row: GridRow, column: GridColumn) => boolean;
202
- onCellSelectionChange?: (payload: {
203
- bounds: {
204
- rowStart: number;
205
- rowEnd: number;
206
- colStart: number;
207
- colEnd: number;
208
- } | null;
209
- cells: Array<{
210
- row: GridRow;
211
- column: GridColumn;
212
- value: any;
213
- rowIndex: number;
214
- colIndex: number;
215
- }>;
216
- }) => void;
217
- onAutosizeColumn?: (columnKey: string) => void;
218
- onAutosizeAllColumns?: () => void;
219
- onResetColumns?: () => void;
220
- pagination?: {
221
- enabled?: boolean;
222
- mode?: PaginationMode;
223
- pageSize?: number;
224
- showPageSizeSelector?: boolean;
225
- pageSizeOptions?: number[];
226
- serverConfig?: ServerPaginationConfig;
227
- };
228
- /** If provided, when total (post-filter) rows <= threshold virtualization is auto-disabled for simpler DOM (default: 300). */
229
- virtualizationThreshold?: number;
230
- onRefresh?: () => void;
231
- isLoading?: boolean;
232
- bulkActions?: BulkActionOption[];
233
- savedFilters?: SavedFilter[];
234
- onSaveFilter?: (filter: Omit<SavedFilter, "id">) => void;
235
- onLoadFilter?: (filter: SavedFilter) => void;
236
- onDeleteFilter?: (filterId: string) => void;
237
- onFilterChange?: (payload: ServerFilterChangePayload) => void;
238
- onSort?: (columnKey: string, direction: "asc" | "desc") => void;
239
- onColumnConfigChange?: (config: ColumnConfig) => void;
240
- initialColumnConfig?: Partial<ColumnConfig>;
241
- toolbarLeft?: ReactNode;
242
- toolbarRight?: ReactNode;
243
- /**
244
- * Controls the visibility of the Group Bar (the area where you can drop headers to group).
245
- * - 'hidden': never show the bar
246
- * - 'auto': show only when there are active grouped columns
247
- * - 'visible': always show when groupable is true
248
- */
249
- groupBarVisibility?: "hidden" | "auto" | "visible";
250
- /**
251
- * How to render group aggregation footer rows when grouping is enabled.
252
- * - 'chips': render a colored summary bar with chips (default)
253
- * - 'columns': render a full-width colored row placing aggregate values under their respective columns
254
- */
255
- groupFooterVariant?: "chips" | "columns";
256
- /**
257
- * Optional custom renderer for actions on grouped rows.
258
- * Receives information about the group and its rows.
259
- */
260
- renderGroupActions?: (groupInfo: {
261
- groupKey: string;
262
- columnKey: string;
263
- groupValue: any;
264
- rows: GridRow[];
265
- count: number;
266
- level: number;
267
- }) => ReactNode;
268
- /**
269
- * Show expand/collapse all group buttons in the toolbar when grouping is enabled.
270
- * Defaults to true.
271
- */
272
- showGroupExpandControls?: boolean;
273
- /**
274
- * Callback invoked when user copies cells (Ctrl/Cmd + C) while cell focus or rectangular selection is active.
275
- * Provides the plain text that was written to the clipboard (tab/newline delimited) and metadata.
276
- */
277
- onCopyCells?: (payload: {
278
- text: string;
279
- /** Present only for rectangular selections */
280
- bounds?: {
281
- rowStart: number;
282
- rowEnd: number;
283
- colStart: number;
284
- colEnd: number;
285
- } | null;
286
- cells: Array<{
287
- row: GridRow;
288
- column: GridColumn;
289
- value: any;
290
- rowIndex: number;
291
- colIndex: number;
292
- }>;
293
- isRectangular: boolean;
294
- isFocusedCell: boolean;
295
- }) => void;
296
- /** Optional controlled selection ids */
297
- selectedRowIds?: Iterable<string | number> | null;
298
- /** Performance optimization settings for large datasets */
299
- performanceConfig?: {
300
- /** Enable horizontal virtualization for large column sets (default: true) */
301
- enableHorizontalVirtualization?: boolean;
302
- /** Column count threshold to enable horizontal virtualization (default: 50) */
303
- horizontalVirtualizationThreshold?: number;
304
- /** Row count threshold to offload sorting to a Web Worker (default: 5000). Set to 0 to always sort inline. */
305
- sortWorkerThreshold?: number;
306
- /** Maximum cache size for filtering operations (default: 5000) */
307
- maxFilterCacheSize?: number;
308
- /** Enable aggressive memoization for large datasets (default: true) */
309
- enableAggressiveMemoization?: boolean;
310
- };
311
- }
312
- export interface ContextMenuItem {
313
- id: string;
314
- label: string;
315
- icon?: ReactNode;
316
- onClick: (row: GridRow) => void;
317
- disabled?: boolean;
318
- separator?: boolean;
319
- }
320
- export type SortDirection = "asc" | "desc" | null;
321
- export interface SortConfig {
322
- key: string | null;
323
- direction: SortDirection;
324
- }
325
- export interface VirtualizedRange {
326
- startIndex: number;
327
- endIndex: number;
328
- offsetY: number;
329
- }
330
- export interface ColumnFilterValue {
331
- type: FilterType;
332
- value: any;
333
- operator?: "equals" | "contains" | "startsWith" | "endsWith" | "gt" | "lt" | "gte" | "lte" | "between";
334
- secondValue?: any;
335
- }
336
- export interface ActiveFilters {
337
- [columnKey: string]: ColumnFilterValue;
338
- }
339
- export interface ColumnConfig {
340
- columnWidths: Record<string, number>;
341
- columnVisibility: Record<string, boolean>;
342
- pinnedColumns: string[];
343
- sortConfig: SortConfig;
344
- /**
345
- * Persisted grouping configuration. New multi-level shape uses columnKeys.
346
- * The legacy single-key field (columnKey) is retained for backward compatibility.
347
- */
348
- groupConfig?: {
349
- columnKeys?: string[];
350
- columnKey?: string | null;
351
- };
352
- filters: {
353
- globalFilter: string;
354
- columnFilters: ActiveFilters;
355
- };
356
- columnOrder?: string[];
357
- density?: Density;
358
- }
359
- export interface PaginationConfig {
360
- enabled: boolean;
361
- pageSize: number;
362
- currentPage: number;
363
- totalPages: number;
364
- totalRows: number;
365
- showPageSizeSelector?: boolean;
366
- pageSizeOptions?: number[];
367
- }
368
- export interface ServerPaginationConfig {
369
- enabled: boolean;
370
- onPageChange: (page: number, pageSize: number) => Promise<void> | void;
371
- onPageSizeChange?: (pageSize: number) => Promise<void> | void;
372
- loading?: boolean;
373
- totalRows: number;
374
- }
375
- export type PaginationMode = "client" | "server";
376
- export interface FilterPopupProps {
377
- column: GridColumn;
378
- data: GridRow[];
379
- currentFilter?: ColumnFilterValue;
380
- onApplyFilter: (filter: ColumnFilterValue | null) => void;
381
- onClose: () => void;
382
- position: {
383
- top: number;
384
- left: number;
385
- };
386
- autoApply?: boolean;
387
- }
388
- export interface ServerFilterChangePayload {
389
- globalFilter: string;
390
- columnFilters: ActiveFilters;
391
- filterableKeys: string[];
392
- searchMode?: SearchMode;
393
- }
394
- /**
395
- * Imperative handle for CustomDataGrid to allow external control of grouping.
396
- * Use with React.forwardRef and useImperativeHandle in the grid component.
397
- */
398
- export interface CustomDataGridRef {
399
- /** Replace the entire ordered grouping keys */
400
- setGroupKeys: (keys: string[]) => void;
401
- /** Add a grouping key at the end if not already present */
402
- addGroupKey: (key: string) => void;
403
- /** Remove a specific grouping key */
404
- removeGroupKey: (key: string) => void;
405
- /** Expand all group paths for the current grouping keys */
406
- expandAllGroups: () => void;
407
- /** Collapse all group paths */
408
- collapseAllGroups: () => void;
409
- /** Toggle a specific group path, e.g. "City=SF|Status=Open" */
410
- toggleGroupExpansion: (groupPath: string) => void;
411
- /** Read the current in-grid grouping configuration */
412
- getGroupConfig: () => GroupConfig;
413
- /** Set a column filter programmatically */
414
- setColumnFilter: (columnKey: string, filter: any) => void;
415
- /** Clear a specific column filter */
416
- clearColumnFilter: (columnKey: string) => void;
417
- /** Clear all column filters */
418
- clearAllFilters: () => void;
419
- /** Set global filter */
420
- setGlobalFilter: (value: string) => void;
421
- }
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- /**
3
- * Highlights matching text within a string based on a search query
4
- * @param text - The text to highlight
5
- * @param searchQuery - The search query to match against
6
- * @returns JSX element with highlighted matches
7
- */
8
- export declare const highlightText: (text: string, searchQuery: string) => React.ReactNode;
9
- /**
10
- * Checks if a value contains the search query (case-insensitive)
11
- * @param value - The value to check
12
- * @param searchQuery - The search query
13
- * @returns true if the value contains the search query
14
- */
15
- export declare const containsSearchQuery: (value: any, searchQuery: string) => boolean;
@@ -1,16 +0,0 @@
1
- export interface WorkerProcessMessage {
2
- type: "process";
3
- payload: {
4
- rows: any[];
5
- sort?: {
6
- key: string;
7
- direction: "asc" | "desc";
8
- } | null;
9
- };
10
- }
11
- export interface WorkerResultMessage {
12
- type: "result";
13
- payload: {
14
- rows: any[];
15
- };
16
- }