@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
83 lines (82 loc) • 2.89 kB
TypeScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { GridSmartBoxSearchProps, GridSmartBoxSearchEvent, SmartBoxMode } from '../interfaces/index.js';
import { GridSmartBoxHistoryProps } from '../interfaces/utilTypes.js';
/**
* Represents the props for the useSmartBoxSearch hook.
*
* @hidden
*/
export interface UseSmartBoxSearchProps {
/**
* The currently selected view mode.
*/
selectedView: SmartBoxMode | null;
/**
* The search mode configuration.
*/
searchMode: GridSmartBoxSearchProps | null;
/**
* The grid columns used for filtering.
*/
columns: Array<{
field: string;
}>;
/**
* The grid context providing access to grid operations.
*/
gridContext: any;
/**
* The history settings for search mode.
*/
searchHistorySettings: GridSmartBoxHistoryProps | null;
/**
* The history settings for semantic search mode.
*/
semanticSearchHistorySettings: GridSmartBoxHistoryProps | null;
/**
* Function to add a new item to the history.
*/
addToHistory: (mode: SmartBoxMode, value: string, historySettings: GridSmartBoxHistoryProps | null) => void;
/**
* Callback function fired when a search is performed.
*/
onSearch?: (event: GridSmartBoxSearchEvent) => void;
/**
* Callback function fired when a semantic search is performed.
*/
onSemanticSearch?: (event: GridSmartBoxSearchEvent) => void;
}
/**
* Represents the return value of the useSmartBoxSearch hook.
*
* @hidden
*/
export interface UseSmartBoxSearchReturn {
/**
* Function to emit a search event with the given value.
* Creates filter descriptors and triggers the appropriate callback
* based on the selected view mode.
*
* @param value - The search value to emit.
*/
emitSearchEvent: (value: string) => void;
}
/**
* Hook to handle search event emission for SmartBox.
*
* This hook creates filter descriptors based on the search value and configured fields,
* emits the appropriate search event (search or semantic search), and optionally
* applies the filter to the grid if the default action is not prevented.
*
* @param props - The hook properties.
* @returns An object containing the emitSearchEvent function.
*
* @hidden
*/
export declare function useSmartBoxSearch({ selectedView, searchMode, columns, gridContext, searchHistorySettings, semanticSearchHistorySettings, addToHistory, onSearch, onSemanticSearch }: UseSmartBoxSearchProps): UseSmartBoxSearchReturn;