/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { AutoComplete } from './AutoComplete.js'; import { ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent } from './../common/events.js'; import { DropDownsPopupSettings, Suggestion } from '../common/settings.js'; import { ListGroupItemProps } from '../common/ListGroupItem.js'; import { GroupStickyHeaderProps } from '../common/GroupStickyHeader.js'; import { ListItemProps } from '../common/ListItem.js'; import { AdaptiveModeContextType, CustomComponent, FormComponentProps } from '@progress/kendo-react-common'; /** * Represents the object of the `change` AutoComplete event. */ export interface AutoCompleteChangeEvent extends ChangeEvent { /** * The suggested value based on the current input. */ suggestion?: Suggestion; } /** * Represents the object of the `open` AutoComplete event. */ export interface AutoCompleteOpenEvent extends OpenEvent { } /** * Represents the object of the `close` AutoComplete event. */ export interface AutoCompleteCloseEvent extends CloseEvent { } /** * Represents the object of the `focus` AutoComplete event. */ export interface AutoCompleteFocusEvent extends FocusEvent { } /** * Represents the object of the `blur` AutoComplete event. */ export interface AutoCompleteBlurEvent extends BlurEvent { } /** * Represents the props of the [KendoReact AutoComplete component](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete). */ export interface AutoCompleteProps extends FormComponentProps { /** * Sets the data of the AutoComplete ([more information and example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/binding)). * * @example * ```jsx * * ``` */ data?: any[]; /** * Sets the opened and closed state of the AutoComplete. * * @example * ```jsx * * ``` */ opened?: boolean; /** * The styles that are applied to the AutoComplete. * * @example * ```jsx * * ``` */ style?: React.CSSProperties; /** * Sets the value of the AutoComplete ([more information and example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/binding)). * * @example * ```jsx * * ``` */ value?: string; /** * Sets the default value of the AutoComplete. Similar to the native `input` HTML element. * * @example * ```jsx * * ``` */ defaultValue?: string; /** * Sets additional classes to the AutoComplete. * * @example * ```jsx * * ``` */ className?: string; /** * By default, the AutoComplete renders a button on hovering over the component, which resets the value. * If `clearButton` is set to `false`, the button will not be rendered. * * @example * ```jsx * * ``` */ clearButton?: boolean; /** * The hint that is displayed when the AutoComplete is empty. * * @example * ```jsx * * ``` */ placeholder?: string; /** * Sets the read-only state of the AutoComplete. * * @example * ```jsx * * ``` */ readonly?: boolean; /** * Enables the auto-completion of the text based on the first data item ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/suggestions)). * * @example * ```jsx * * ``` */ suggest?: boolean | string; /** * Sets the disabled state of the AutoComplete. * * @example * ```jsx * * ``` */ disabled?: boolean; /** * Represents the `dir` HTML attribute. * * @example * ```jsx * * ``` */ dir?: string; /** * Sets the loading state of the AutoComplete ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/filtering#toc-basic-configuration)). * * @example * ```jsx * * ``` */ loading?: boolean; /** * Specifies the `tabIndex` of the AutoComplete. * * @example * ```jsx * * ``` * * @remarks * This property is related to accessibility. */ tabIndex?: number; /** * Specifies the `accessKey` of the AutoComplete. * * @example * ```jsx * * ``` * * @remarks * This property is related to accessibility. */ accessKey?: string; /** * Sets the data item field that represents the item text ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/binding#toc-datasets-of-objects)). If the data contains only primitive values, do not define it. * * @example * ```jsx * * ``` */ textField?: string; /** * Renders a floating label for the AutoComplete. * * @example * ```jsx * * ``` */ label?: string; /** * Configures the popup of the AutoComplete. * * @example * ```jsx * * ``` */ popupSettings?: DropDownsPopupSettings; /** * Specifies the id of the component. * * @example * ```jsx * * ``` */ id?: string; /** * Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute). * For example these elements could contain error or hint message. * * @example * ```jsx * * ``` * * @remarks * This property is related to accessibility. */ ariaDescribedBy?: string; /** * Identifies the element(s) which will label the component. * * @example * ```jsx * * ``` * * @remarks * This property is related to accessibility. */ ariaLabelledBy?: string; /** * If set, the AutoComplete will use it to get the focused item index. * * Default functionality returns the first item which starts with the input text. * * @example * ```jsx * const focusedItemIndex = (data, inputText, textField) => { * let text = inputText.toLowerCase(); * return data.findIndex(item => * String(textField ? item[textField] : item).toLowerCase().includes(text)); * }; * * * ``` */ focusedItemIndex?: (data: any, inputText: string, textField?: string) => number; /** * Fires each time the popup of the AutoComplete is about to open. * * @example * ```jsx * console.log('Popup opened', event)} /> * ``` */ onOpen?: (event: AutoCompleteOpenEvent) => void; /** * Fires each time the popup of the AutoComplete is about to close. * * @example * ```jsx * console.log('Popup closed', event)} /> * ``` */ onClose?: (event: AutoCompleteCloseEvent) => void; /** * Fires each time the user focuses the AutoComplete. * * @example * ```jsx * console.log('Focused', event)} /> * ``` */ onFocus?: (event: AutoCompleteFocusEvent) => void; /** * Fires each time the AutoComplete gets blurred. * * @example * ```jsx * console.log('Blurred', event)} /> * ``` */ onBlur?: (event: AutoCompleteBlurEvent) => void; /** * Fires each time the value of the AutoComplete is about to change ([more information and example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/binding)). * * @example * ```jsx * console.log('Value changed', event)} /> * ``` */ onChange?: (event: AutoCompleteChangeEvent) => void; /** * Fires when the AutoComplete input element is about to be rendered. Use it to override the default appearance of the component. * * @example * ```jsx * {rendering}} /> * ``` */ valueRender?: (rendering: React.ReactElement) => React.ReactNode; /** * Fires when an AutoComplete list item is about to be rendered ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/custom-rendering#toc-items)). Used to override the default appearance of the list items. * * @example * ```jsx *
  • {itemProps.dataItem}
  • } /> * ``` */ itemRender?: (li: React.ReactElement, itemProps: ListItemProps) => React.ReactNode; /** * Fires when the element which indicates no data in the popup is about to be rendered ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/custom-rendering#toc-no-data)). Used to override the default appearance of the element. * * @example * ```jsx *
    No data available
    } /> * ``` */ listNoDataRender?: (element: React.ReactElement) => React.ReactNode; /** * Sets the header component of the AutoComplete ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/custom-rendering#toc-headers-and-footers)). * * @example * ```jsx * Header} /> * ``` */ header?: React.ReactNode; /** * Sets the footer component of the AutoComplete ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/autocomplete/custom-rendering#toc-headers-and-footers)). * * @example * ```jsx * Footer} /> * ``` */ footer?: React.ReactNode; /** * Configures the `size` of the AutoComplete. * * The available options are: * - small * - medium * - large * * @default undefined (theme-controlled) * * @example * ```jsx * * ``` */ size?: 'small' | 'medium' | 'large'; /** * Configures the `roundness` of the AutoComplete. * * The available options are: * - small * - medium * - large * - full * * @default undefined (theme-controlled) * * @example * ```jsx * * ``` */ rounded?: 'small' | 'medium' | 'large' | 'full' | 'none'; /** * Configures the `fillMode` of the AutoComplete. * * The available options are: * - solid * - flat * - outline * * @default undefined (theme-controlled) * * @example * ```jsx * * ``` */ fillMode?: 'solid' | 'flat' | 'outline'; /** * Sets the data item field that represents the start of a group. Applicable to objects data. * * @example * ```jsx * * ``` */ groupField?: string; /** * Fires when a AutoComplete group header item is about to be rendered. Used to override the default appearance of the group's headers. * * @example * ```jsx *
  • {itemProps.dataItem}
  • } /> * ``` */ groupHeaderItemRender?: (li: React.ReactElement, itemProps: ListGroupItemProps) => React.ReactNode; /** * Fires when a AutoComplete sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component. * * @example * ```jsx *
    {stickyHeaderProps.dataItem}
    } /> * ``` */ groupStickyHeaderItemRender?: (div: React.ReactElement, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode; /** * @hidden */ list?: any; /** * Sets the key for comparing the data items of the AutoComplete. If `dataItemKey` is not set, the AutoComplete compares the items by reference. * * @example * ```jsx * * ``` */ dataItemKey?: string; /** * Providing different rendering of the popup element based on the screen dimensions. * * @default `false` * * @example * ```jsx * * ``` */ adaptive?: boolean; /** * Specifies the text that is rendered as title in the adaptive popup(action sheet). * Applicable only when `adaptive` is set to `true`. * If not provided, the title will be the same as the label. * * @example * ```jsx * * ``` */ adaptiveTitle?: string; /** * Specifies the text that is rendered as subtitle in the adaptive popup(action sheet). * Applicable only when `adaptive` is set to `true`. * * @example * ```jsx * * ``` */ adaptiveSubtitle?: string; /** * Defines if AutoComplete's disabled items will be skipped or focused when navigating through the list of items using a keyboard. Defaults to `true`. * * @example * ```jsx * * ``` * * @remarks * This property is related to accessibility. */ skipDisabledItems?: boolean; /** * Sets a custom prefix to the AutoComplete component. * * @example * ```jsx * Prefix} /> * ``` */ prefix?: CustomComponent; /** * Sets a custom suffix to the AutoComplete component. * * @example * ```jsx * Suffix} /> * ``` */ suffix?: CustomComponent; /** * Sets the HTML attributes of the inner focusable input element. * Attributes which are essential for certain component functionalities cannot be changed. * * @example * ```jsx * * ``` * * @remarks * This property is related to accessibility. */ inputAttributes?: React.InputHTMLAttributes; /** * @hidden * This prop is provided by the withAdaptiveModeContext HOC to subscribe to AdaptiveModeContext. */ _adaptiveMode?: AdaptiveModeContextType; }