@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
97 lines (96 loc) • 3 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 { SpeechToTextResultEvent } from '@progress/kendo-react-buttons';
import { SmartBoxMode } from '../interfaces/index.js';
import * as React from 'react';
/**
* Represents the props for the useSmartBoxInput hook.
*
* @hidden
*/
export interface UseSmartBoxInputProps {
/**
* The currently selected view mode.
*/
selectedView: SmartBoxMode | null;
/**
* Ref to the input element.
*/
inputRef: React.RefObject<HTMLInputElement | null>;
/**
* Function to toggle the popup visibility.
*/
togglePopup: (open: boolean) => void;
/**
* Function to emit a search event with the provided value.
*/
emitSearchEvent: (value: string) => void;
/**
* State setter for the search value.
*/
setSearchValue: React.Dispatch<React.SetStateAction<string | null>>;
/**
* Callback fired when the input receives focus.
*/
onFocus?: () => void;
/**
* Callback fired when the input loses focus.
*/
onBlur?: () => void;
}
/**
* Represents the return value of the useSmartBoxInput hook.
*
* @hidden
*/
export interface UseSmartBoxInputResult {
/**
* The current value of the input.
*/
inputValue: string;
/**
* State setter for the input value.
*/
setInputValue: React.Dispatch<React.SetStateAction<string>>;
/**
* Handler for input change events.
*/
handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
/**
* Handler for input focus events.
*/
handleInputFocus: () => void;
/**
* Handler for input click events.
*/
handleInputClick: () => void;
/**
* Handler for clearing the input value.
*/
handleClearValue: (event: React.MouseEvent) => void;
/**
* Handler for speech-to-text result events.
*/
handleSpeechResult: (event: SpeechToTextResultEvent) => void;
/**
* Handler for blur events on the wrapper element.
*/
handleWrapperBlur: (event: React.FocusEvent<HTMLDivElement>, wrapperRef: React.RefObject<HTMLDivElement | null>) => void;
}
/**
* Hook to manage SmartBox input state and event handlers.
*
* This hook provides input value management and event handlers for
* text input, focus, blur, clear, and speech-to-text functionality.
*
* @param props - The hook properties.
* @returns An object containing input state and event handlers.
*
* @hidden
*/
export declare function useSmartBoxInput({ selectedView, inputRef, togglePopup, emitSearchEvent, setSearchValue, onFocus, onBlur }: UseSmartBoxInputProps): UseSmartBoxInputResult;