/** * * SelectButton is used to choose single or multiple items from a list using buttons. * * [Live Demo](https://www.primereact.org/selectbutton/) * * @module selectbutton * */ import * as React from 'react'; import { SelectItemOptionsType } from '../selectitem/selectitem'; import { TooltipPassThroughOptions } from '../tooltip/tooltip'; import { TooltipOptions } from '../tooltip/tooltipoptions'; import { FormEvent } from '../ts-helpers'; import { PassThroughType } from '../utils/utils'; export declare type SelectButtonPassThroughType = PassThroughType; /** * Custom passthrough(pt) option method. */ export interface SelectButtonPassThroughMethodOptions { props: SelectButtonProps; context: SelectButtonContext; } /** * Custom passthrough(pt) options. * @see {@link SelectButtonProps.pt} */ export interface SelectButtonPassThroughOptions { /** * Uses to pass attributes to the root's DOM element. */ root?: SelectButtonPassThroughType>; /** * Uses to pass attributes to the button's DOM element. */ button?: SelectButtonPassThroughType>; /** * Uses to pass attributes to the label's DOM element. */ label?: SelectButtonPassThroughType>; /** * Uses to pass attributes tooltip's DOM element. * @type {TooltipPassThroughOptions} */ tooltip?: TooltipPassThroughOptions; } /** * Defines current options in SelectButton component. */ export interface SelectButtonContext { /** * Current selected value. */ selected: any; } /** * Custom change event. * @see {@link SelectButtonProps.onChange} * @extends {FormEvent} * @event */ interface SelectButtonChangeEvent extends FormEvent {} /** * Defines valid properties in SelectButton component. In addition to these, all properties of HTMLDivElement can be used in this component. * @group Properties */ export interface SelectButtonProps extends Omit, HTMLDivElement>, 'unselectable' | 'onChange' | 'ref' | 'pt'> { /** * Value of the component. */ value?: any | undefined; /** * An array of objects to display as the available options. */ options?: SelectItemOptionsType | undefined; /** * Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options. */ optionLabel?: string | undefined; /** * Name of the value field of an option when arbitrary objects are used as options instead of SelectItems. */ optionValue?: string | undefined; /** * Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. */ optionDisabled?: string | ((option: any) => boolean); /** * Index of the element in tabbing order. */ tabIndex?: number | undefined; /** * When specified, allows selecting multiple values. * @defaultValue false */ multiple?: boolean | undefined; /** * Whether selection can be cleared. * @defaultValue true */ unselectable?: boolean | undefined; /** * When present, it specifies that the element should be disabled. * @defaultValue false */ disabled?: boolean | undefined; /** * A property to uniquely match the value in options for better performance. */ dataKey?: string | undefined; /** * Content of the tooltip. */ tooltip?: string | undefined; /** * Configuration of the tooltip, refer to the tooltip documentation for more information. */ tooltipOptions?: TooltipOptions | undefined; /** * Establishes relationships between the component and label(s) where its value should be one or more element IDs. */ ariaLabelledBy?: string | undefined; /** * Function that gets the option and returns the content. * @param {*} item - Current item */ itemTemplate?(item: any): React.ReactNode; /** * Callback to invoke on value change. * @param {SelectButtonChangeEvent} event - Custom change event. */ onChange?(event: SelectButtonChangeEvent): void; /** * Used to get the child elements of the component. * @readonly */ children?: React.ReactNode | undefined; /** * Uses to pass attributes to DOM elements inside the component. * @type {SelectButtonPassThroughOptions} */ pt?: SelectButtonPassThroughOptions; } /** * **PrimeReact - SelectButton** * * _SelectButton is used to choose single or multiple items from a list using buttons._ * * [Live Demo](https://www.primereact.org/selectbutton/) * --- --- * ![PrimeReact](https://primefaces.org/cdn/primereact/images/logo-100.png) * * @group Component */ export declare class SelectButton extends React.Component { /** * Used to get container element. * @return {HTMLDivElement} Container element */ public getElement(): HTMLDivElement; /** * Used to focus the component. */ public focus(): void; }