react-kd-grid 5.0.3 → 5.0.8

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 (59) hide show
  1. package/dist/components/ui/CustomSelect.d.ts +14 -0
  2. package/dist/components/ui/Popover.d.ts +17 -0
  3. package/dist/grid/components/Filters/BooleanFilter.d.ts +7 -0
  4. package/dist/grid/components/Filters/DateFilter.d.ts +9 -0
  5. package/dist/grid/components/Filters/FilterContent.d.ts +9 -0
  6. package/dist/grid/components/Filters/FilterPopup.d.ts +2 -0
  7. package/dist/grid/components/Filters/MultiselectFilter.d.ts +10 -0
  8. package/dist/grid/components/Filters/NumberFilter.d.ts +9 -0
  9. package/dist/grid/components/Filters/TextFilter.d.ts +8 -0
  10. package/dist/grid/components/Filters/index.d.ts +6 -0
  11. package/dist/grid/components/Popovers/BulkActionPopover.d.ts +17 -0
  12. package/dist/grid/components/Popovers/ColumnVisibilityPopover.d.ts +35 -0
  13. package/dist/grid/components/Popovers/ExportPopover.d.ts +18 -0
  14. package/dist/grid/components/Popovers/FilterPopover.d.ts +29 -0
  15. package/dist/grid/components/Popovers/SettingsPopover.d.ts +17 -0
  16. package/dist/grid/components/Shared/CellEditor.d.ts +23 -0
  17. package/dist/grid/components/Shared/ColumnFilterSelector.d.ts +18 -0
  18. package/dist/grid/components/Shared/FooterAggregate.d.ts +16 -0
  19. package/dist/grid/components/Shared/GridHeader.d.ts +39 -0
  20. package/dist/grid/components/Shared/GridRows.d.ts +53 -0
  21. package/dist/grid/components/Shared/GroupBar.d.ts +12 -0
  22. package/dist/grid/components/Shared/GroupHeader.d.ts +29 -0
  23. package/dist/grid/components/Shared/LicenseError.d.ts +9 -0
  24. package/dist/grid/components/Shared/NoDataMessage.d.ts +11 -0
  25. package/dist/grid/components/Shared/PaginationControls.d.ts +18 -0
  26. package/dist/grid/components/Shared/RowContextMenu.d.ts +18 -0
  27. package/dist/grid/components/Toolbar/Toolbar.d.ts +70 -0
  28. package/dist/grid/constants/index.d.ts +1 -0
  29. package/dist/grid/constants/toolbar.d.ts +17 -0
  30. package/dist/grid/core/DataGrid.d.ts +3 -0
  31. package/dist/grid/core/GridBodyContainer.d.ts +83 -0
  32. package/dist/grid/core/GridFooterContainer.d.ts +23 -0
  33. package/dist/grid/core/GridToolbarContainer.d.ts +48 -0
  34. package/dist/grid/hooks/toolbar/useColumnDnD.d.ts +28 -0
  35. package/dist/grid/hooks/toolbar/useToolbarMenus.d.ts +29 -0
  36. package/dist/grid/hooks/useAdvancedFiltering.d.ts +18 -0
  37. package/dist/grid/hooks/useCellSelection.d.ts +67 -0
  38. package/dist/grid/hooks/useColumnState.d.ts +52 -0
  39. package/dist/grid/hooks/useDataWorker.d.ts +11 -0
  40. package/dist/grid/hooks/useEditingCell.d.ts +49 -0
  41. package/dist/grid/hooks/useExport.d.ts +14 -0
  42. package/dist/grid/hooks/useGridDataMaps.d.ts +17 -0
  43. package/dist/grid/hooks/useGridMethods.d.ts +20 -0
  44. package/dist/grid/hooks/useGrouping.d.ts +28 -0
  45. package/dist/grid/hooks/useHorizontalVirtualization.d.ts +18 -0
  46. package/dist/grid/hooks/useInfiniteScroll.d.ts +31 -0
  47. package/dist/grid/hooks/useLoadingBar.d.ts +21 -0
  48. package/dist/grid/hooks/usePagination.d.ts +28 -0
  49. package/dist/grid/hooks/useScrollSync.d.ts +29 -0
  50. package/dist/grid/hooks/useSelection.d.ts +13 -0
  51. package/dist/grid/hooks/useVirtualization.d.ts +17 -0
  52. package/dist/grid/types.d.ts +570 -0
  53. package/dist/grid/utils/dateUtils.d.ts +16 -0
  54. package/dist/grid/utils/highlightText.d.ts +15 -0
  55. package/dist/grid/utils/license.d.ts +3 -0
  56. package/dist/index.d.ts +21 -12
  57. package/dist/index.esm.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/package.json +1 -1
@@ -0,0 +1,14 @@
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 {};
@@ -0,0 +1,17 @@
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;
@@ -0,0 +1,7 @@
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 {};
@@ -0,0 +1,9 @@
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 {};
@@ -0,0 +1,9 @@
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 {};
@@ -0,0 +1,2 @@
1
+ import { FilterPopupProps } from "../../types";
2
+ export declare const FilterPopup: ({ column, data, currentFilter, onApplyFilter, onClose, position, autoApply, }: FilterPopupProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
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 {};
@@ -0,0 +1,9 @@
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 {};
@@ -0,0 +1,8 @@
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 {};
@@ -0,0 +1,6 @@
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';
@@ -0,0 +1,17 @@
1
+ import { BulkActionOption } from "../../types";
2
+ interface BulkActionPopoverProps {
3
+ isOpen: boolean;
4
+ anchorEl: HTMLElement | null;
5
+ onClose: () => void;
6
+ bulkActions: BulkActionOption[];
7
+ selectedRowsCount: number;
8
+ onBulkAction: (action: BulkActionOption) => void;
9
+ }
10
+ /**
11
+ * BulkActionPopover
12
+ *
13
+ * Displays a menu of actions that can be globally applied to all currently selected grid rows.
14
+ * Features customizable icons and labels per action.
15
+ */
16
+ export declare const BulkActionPopover: ({ isOpen, anchorEl, onClose, bulkActions, selectedRowsCount, onBulkAction, }: BulkActionPopoverProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ interface ColumnDefinition {
3
+ key: string;
4
+ header: string;
5
+ }
6
+ interface ColumnVisibilityPopoverProps {
7
+ isOpen: boolean;
8
+ anchorEl: HTMLElement | null;
9
+ onClose: () => void;
10
+ filteredColumns: ColumnDefinition[];
11
+ columnVisibility: Record<string, boolean>;
12
+ onColumnToggle: (columnKey: string) => void;
13
+ columnSearch: string;
14
+ onColumnSearchChange: (value: string) => void;
15
+ onResetColumns: () => void;
16
+ onScrollToColumn?: (columnKey: string) => void;
17
+ onColumnVisibilityChange?: (columnKey: string, visible: boolean) => void;
18
+ draggingKey: string | null;
19
+ dragOver: {
20
+ key: string;
21
+ position: "before" | "after";
22
+ } | null;
23
+ handleDragStart: (columnKey: string, e: React.DragEvent) => void;
24
+ handleDragOver: (targetKey: string, e: React.DragEvent) => void;
25
+ handleDrop: (targetKey: string) => void;
26
+ handleDragEnd: () => void;
27
+ }
28
+ /**
29
+ * ColumnVisibilityPopover
30
+ *
31
+ * Provides the UI for toggling column visibility and reordering columns via drag-and-drop.
32
+ * Includes column search and reset functionality.
33
+ */
34
+ export declare const ColumnVisibilityPopover: ({ isOpen, anchorEl, onClose, filteredColumns, columnVisibility, onColumnToggle, columnSearch, onColumnSearchChange, onResetColumns, onScrollToColumn, onColumnVisibilityChange, draggingKey, dragOver, handleDragStart, handleDragOver, handleDrop, handleDragEnd, }: ColumnVisibilityPopoverProps) => import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ExportFormat } from "../../types";
2
+ interface ExportPopoverProps {
3
+ isOpen: boolean;
4
+ anchorEl: HTMLElement | null;
5
+ onClose: () => void;
6
+ exportFormats: ExportFormat[];
7
+ filteredDataLength: number;
8
+ selectedRowsCount: number;
9
+ onExport: (format: ExportFormat, exportSelected: boolean) => void;
10
+ }
11
+ /**
12
+ * ExportPopover
13
+ *
14
+ * Provides the UI for exporting grid data in various formats (CSV, JSON, Excel).
15
+ * Allows exporting either all filtered data or only the currently selected rows.
16
+ */
17
+ export declare const ExportPopover: ({ isOpen, anchorEl, onClose, exportFormats, filteredDataLength, selectedRowsCount, onExport, }: ExportPopoverProps) => import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,29 @@
1
+ interface ColumnDefinition {
2
+ key: string;
3
+ header: string;
4
+ visible?: boolean;
5
+ filterOptions?: Array<{
6
+ label: string;
7
+ value: string | number;
8
+ }>;
9
+ filterType?: "text" | "select" | "multiselect";
10
+ filterable?: any;
11
+ }
12
+ interface FilterPopoverProps {
13
+ isOpen: boolean;
14
+ anchorEl: HTMLElement | null;
15
+ onClose: () => void;
16
+ onClearFilters?: () => void;
17
+ columns: ColumnDefinition[];
18
+ columnFilters: Record<string, any>;
19
+ onColumnFilter?: (columnKey: string, filter: any) => void;
20
+ hasFilterableColumns: boolean;
21
+ }
22
+ /**
23
+ * FilterPopover
24
+ *
25
+ * Provides the UI for managing column-specific filters.
26
+ * Includes a search/select interface for each filterable column and a clear all action.
27
+ */
28
+ export declare const FilterPopover: ({ isOpen, anchorEl, onClose, onClearFilters, columns, columnFilters, onColumnFilter, hasFilterableColumns, }: FilterPopoverProps) => import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1,17 @@
1
+ import { Density } from "../../types";
2
+ interface SettingsPopoverProps {
3
+ isOpen: boolean;
4
+ anchorEl: HTMLElement | null;
5
+ onClose: () => void;
6
+ density: Density;
7
+ onDensityChange?: (density: Density) => void;
8
+ showDensityControl?: boolean;
9
+ }
10
+ /**
11
+ * SettingsPopover
12
+ *
13
+ * Provides a menu for general grid configurations.
14
+ * Currently supports Row Density selection and is easily extensible for future settings.
15
+ */
16
+ export declare const SettingsPopover: ({ isOpen, anchorEl, onClose, density, onDensityChange, showDensityControl, }: SettingsPopoverProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * CellEditor
3
+ *
4
+ * Renders the appropriate input control for an inline cell edit session.
5
+ * Lifecycle:
6
+ * • mounts → auto-focuses, selects all existing text
7
+ * • Enter / Tab → commit (Tab also moves focus to next cell conceptually)
8
+ * • Escape → cancel
9
+ * • blur → commit (unless blur was caused by Escape)
10
+ *
11
+ * Props are intentionally minimal — the parent hook owns the "editing cell"
12
+ * identity; this component only owns the *draft value* and input DOM state.
13
+ */
14
+ import type { GridColumn, GridRow } from "../../types";
15
+ interface CellEditorProps {
16
+ column: GridColumn;
17
+ row: GridRow;
18
+ initialValue: any;
19
+ onCommit: (newValue: any) => void;
20
+ onCancel: () => void;
21
+ }
22
+ export declare const CellEditor: ({ column, row, initialValue, onCommit, onCancel, }: CellEditorProps) => import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,18 @@
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 {};
@@ -0,0 +1,16 @@
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 {};
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { GridColumn, SortConfig, ActiveFilters, ColumnFilterValue, GridRow } from "../../types";
3
+ interface GridHeaderProps {
4
+ pinnedColumns: GridColumn[];
5
+ unpinnedColumns: GridColumn[];
6
+ hvPadLeft?: number;
7
+ hvPadRight?: number;
8
+ headerHeight: number;
9
+ sortConfig: SortConfig;
10
+ columnFilters: ActiveFilters;
11
+ selectable: boolean;
12
+ selectedRows: Set<string | number>;
13
+ totalRows: number;
14
+ data: GridRow[];
15
+ onSort: (key: string) => void;
16
+ onColumnFilter: (key: string, filter: ColumnFilterValue | null) => void;
17
+ onSelectAll: () => void;
18
+ onColumnResize?: (columnKey: string, width: number) => void;
19
+ pinnedKeySet?: Set<string>;
20
+ onColumnPin?: (columnKey: string, pinned: boolean) => void;
21
+ groupable?: boolean;
22
+ groupedByColumn?: string | null;
23
+ onGroupBy?: (columnKey: string | null) => void;
24
+ groupedByColumns?: string[];
25
+ onGroupToggle?: (columnKey: string, nextGrouped: boolean) => void;
26
+ onAutosizeColumn?: (columnKey: string) => void;
27
+ onAutosizeAllColumns?: () => void;
28
+ onResetColumns?: () => void;
29
+ columnOrder: string[];
30
+ onColumnOrderChange: (order: string[]) => void;
31
+ paginationMode?: "client" | "server" | null;
32
+ /** Minimum column width enforced during drag-resize. Defaults to 80px. */
33
+ minResizeWidth?: number;
34
+ }
35
+ export declare const GridHeader: React.MemoExoticComponent<{
36
+ ({ 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, minResizeWidth, }: GridHeaderProps): import("react/jsx-runtime").JSX.Element;
37
+ displayName: string;
38
+ }>;
39
+ export {};
@@ -0,0 +1,53 @@
1
+ import { CSSProperties, MouseEvent } from "react";
2
+ import { GridRow, GridColumn, VirtualizedRange, ContextMenuItem, RowEventParams, CellClickParams, CellContextMenuParams } 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?: (params: RowEventParams) => void;
19
+ onRowDoubleClick?: (params: RowEventParams) => void;
20
+ onRowClick?: (params: RowEventParams) => void;
21
+ onCellClick?: (params: CellClickParams) => void;
22
+ isCellFocused?: (rowId: string | number, columnKey: string) => boolean;
23
+ isCellSelected?: (rowId: string | number, columnKey: string) => boolean;
24
+ onCellContextMenu?: (params: CellContextMenuParams) => void;
25
+ onCellMouseDown?: (args: {
26
+ row: GridRow;
27
+ column: GridColumn;
28
+ event: MouseEvent;
29
+ }) => void;
30
+ onCellMouseEnter?: (args: {
31
+ row: GridRow;
32
+ column: GridColumn;
33
+ event: MouseEvent;
34
+ }) => void;
35
+ /** Custom items for the row right-click context menu. */
36
+ contextMenuItems?: ContextMenuItem[];
37
+ getRowId?: (row: GridRow) => string | number;
38
+ /** Returns true when a specific (rowId, columnKey) pair is currently being edited. */
39
+ isEditing?: (rowId: string | number, columnKey: string) => boolean;
40
+ /** Called when the user double-clicks (or presses F2 on) an editable cell. */
41
+ onStartEdit?: (row: GridRow, column: GridColumn) => void;
42
+ /** Called by CellEditor when the user commits a value. */
43
+ onCommitEdit?: (newValue: any) => void;
44
+ /** Called by CellEditor when the user cancels without saving. */
45
+ onCancelEdit?: () => void;
46
+ /** The current edit initial value — passed down to CellEditor to initialise draft state. */
47
+ editingInitialValue?: any;
48
+ }
49
+ export declare const GridRows: import("react").MemoExoticComponent<{
50
+ ({ data, columns, selectedRows, virtualized, virtualizedRange, rowHeight, selectable, isRowSelectable, onRowSelect, pinnedColumns, hvPadLeft, hvPadRight, rowStyle, globalFilter, onContextMenu, onRowDoubleClick, onRowClick, onCellClick, isCellFocused, isCellSelected, onCellContextMenu, onCellMouseDown, onCellMouseEnter, contextMenuItems, getRowId, isEditing, onStartEdit, onCommitEdit, onCancelEdit, editingInitialValue, }: GridRowsProps): import("react/jsx-runtime").JSX.Element;
51
+ displayName: string;
52
+ }>;
53
+ export {};
@@ -0,0 +1,12 @@
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 {};
@@ -0,0 +1,29 @@
1
+ import { GridRow, KDGridProps } 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?: KDGridProps["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 {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * LicenseError
3
+ *
4
+ * Shown inside the grid body when an invalid or missing `licenseKey` is
5
+ * detected. Rendering it in the body (rather than replacing the entire
6
+ * component) keeps the column header visible so consumers can still see
7
+ * the grid structure and understand what data *should* be there.
8
+ */
9
+ export declare const LicenseError: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ interface NoDataMessageProps {
3
+ hasFilters?: boolean;
4
+ hasData?: boolean;
5
+ /** Custom text message. Overridden by `renderer` if both are set. */
6
+ message?: string;
7
+ /** Fully custom empty-state renderer — takes precedence over `message`. */
8
+ renderer?: () => ReactNode;
9
+ }
10
+ export declare const NoDataMessage: ({ hasFilters, hasData, message, renderer, }: NoDataMessageProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,18 @@
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: import("react").MemoExoticComponent<{
15
+ ({ paginationConfig, currentPage, isServerLoading, selectedRowsCount, totalDataLength, filteredDataLength, paginationMode, onPageChange, onPageSizeChange, }: PaginationControlsProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ }>;
18
+ export {};
@@ -0,0 +1,18 @@
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[];
6
+ interface RowContextMenuProps {
7
+ row: GridRow;
8
+ position: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ isVisible: boolean;
13
+ onClose: () => void;
14
+ /** Custom menu items. If not provided the menu will not render. */
15
+ menuItems?: ContextMenuItem[];
16
+ }
17
+ export declare const RowContextMenu: ({ row, position, isVisible, onClose, menuItems, }: RowContextMenuProps) => import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,70 @@
1
+ import { ChangeEvent, ReactNode } from "react";
2
+ import type { BulkActionOption, Density, ExportFormat, SavedFilter } from "../../types";
3
+ interface ColumnVisibility {
4
+ [columnKey: string]: boolean;
5
+ }
6
+ interface SearchToolbarProps {
7
+ globalFilter: string;
8
+ filteredDataLength: number;
9
+ totalDataLength: number;
10
+ paginationMode?: "client" | "server";
11
+ totalRows?: number;
12
+ selectedRowsCount?: number;
13
+ selectedRows?: Set<string | number>;
14
+ showExport?: boolean;
15
+ showRefresh?: boolean;
16
+ showColumnToggle?: boolean;
17
+ showBulkActions?: boolean;
18
+ showSavedFilters?: boolean;
19
+ columns?: Array<{
20
+ key: string;
21
+ header: string;
22
+ visible?: boolean;
23
+ filterOptions?: Array<{
24
+ label: string;
25
+ value: string | number;
26
+ }>;
27
+ filterType?: "text" | "select" | "multiselect";
28
+ filterable?: any;
29
+ }>;
30
+ columnVisibility?: ColumnVisibility;
31
+ columnFilters?: Record<string, any>;
32
+ savedFilters?: SavedFilter[];
33
+ bulkActions?: BulkActionOption[];
34
+ loading?: boolean;
35
+ exportOptions?: {
36
+ enabled: boolean;
37
+ formats?: ExportFormat[];
38
+ filename?: string;
39
+ onExport?: (format: ExportFormat, exportSelected: boolean) => void;
40
+ };
41
+ onGlobalFilterChange: (e: ChangeEvent<HTMLInputElement>) => void;
42
+ onClearFilters?: () => void;
43
+ onRefresh?: () => void;
44
+ onColumnVisibilityChange?: (columnKey: string, visible: boolean) => void;
45
+ onColumnFilter?: (columnKey: string, filter: any) => void;
46
+ onSaveFilter?: (filter: Omit<SavedFilter, "id">) => void;
47
+ onLoadFilter?: (filter: SavedFilter) => void;
48
+ onDeleteFilter?: (filterId: string) => void;
49
+ onRowSelect?: (selectedRows: number[]) => void;
50
+ onToggleFilters?: (show: boolean) => void;
51
+ onResetColumns?: () => void;
52
+ columnOrder?: string[];
53
+ onColumnOrderChange?: (order: string[]) => void;
54
+ pinnedColumns?: Set<string>;
55
+ onScrollToColumn?: (columnKey: string) => void;
56
+ density?: Density;
57
+ onDensityChange?: (density: Density) => void;
58
+ showDensityControl?: boolean;
59
+ customLeftContent?: ReactNode;
60
+ customRightContent?: ReactNode;
61
+ }
62
+ /**
63
+ * Optimized SearchToolbar using React.memo to prevent unnecessary re-renders
64
+ * as users type in the global search or modify filters.
65
+ */
66
+ export declare const Toolbar: import("react").MemoExoticComponent<{
67
+ ({ globalFilter, filteredDataLength, totalDataLength, 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;
68
+ displayName: string;
69
+ }>;
70
+ export {};
@@ -0,0 +1 @@
1
+ export declare const SELECT_COL_WIDTH = 48;
@@ -0,0 +1,17 @@
1
+ import { ExportFormat, Density } from "../types";
2
+ /**
3
+ * Mappings for Export formats to their respective icons.
4
+ */
5
+ export declare const getExportIcon: (format: ExportFormat) => import("react/jsx-runtime").JSX.Element;
6
+ /**
7
+ * Mappings for Bulk Action IDs to their respective icons.
8
+ */
9
+ export declare const getBulkActionIcon: (action: string) => import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * Human-readable labels for export formats.
12
+ */
13
+ export declare const getFormatLabel: (format: ExportFormat) => "CSV" | "JSON" | "Excel";
14
+ /**
15
+ * Default density options for the grid.
16
+ */
17
+ export declare const DENSITY_OPTIONS: Density[];
@@ -0,0 +1,3 @@
1
+ import type { KDGridProps, KDGridRef } from "../types";
2
+ export declare const KDGrid: import("react").ForwardRefExoticComponent<KDGridProps & import("react").RefAttributes<KDGridRef>>;
3
+ export default KDGrid;