@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
51 lines • 1.91 kB
TypeScript
/** @packageDocumentation
* @module SearchBox
*/
import "./SearchBox.scss";
import * as React from "react";
import type { CommonProps } from "../utils/Props.js";
/** Properties for [[SearchBox]] component
* @public
* @deprecated in 4.12.0. Props of deprecated component {@link SearchBox}.
*/
export interface SearchBoxProps extends CommonProps {
/** Value to set SearchBox to initially */
initialValue?: string;
/** Placeholder value to show in gray before anything is entered in */
placeholder?: string;
/** Triggered when the content of SearchBox is changed */
onValueChanged: (value: string) => void;
/** Frequency to poll for changes in value, in milliseconds */
valueChangedDelay?: number;
/** Listens for <Enter> keypress */
onEnterPressed?: () => void;
/** Listens for <Esc> keypress */
onEscPressed?: () => void;
/** Listens for onClick event for Clear (x) icon */
onClear?: () => void;
}
interface SearchBoxState {
value: string;
}
/** Input box for entering text to search for.
* The SearchBox has an icon right-justified and bounded by the box and shows a Search or Clear icon.
* @public
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/searchbox iTwinUI SearchBox} instead.
*/
export declare class SearchBox extends React.Component<SearchBoxProps, SearchBoxState> {
private _inputElement;
private _timeoutId;
readonly state: Readonly<SearchBoxState>;
constructor(props: SearchBoxProps);
render(): React.ReactNode;
/** Wrapper for onValueChanged to make sure we don't call search unless the new value is different from the previous value */
private _onValueChanged;
private _trackChange;
private _handleKeyDown;
private _handleIconClick;
private _unsetTimeout;
componentWillUnmount(): void;
focus(): void;
}
export {};
//# sourceMappingURL=SearchBox.d.ts.map