primevue-mirror/components/lib/dropdown/Dropdown.d.ts

768 lines
22 KiB
TypeScript
Raw Normal View History

2023-03-01 10:43:09 +00:00
/**
*
* Dropdown also known as Select, is used to choose an item from a collection of options.
*
2023-03-01 13:05:44 +00:00
* [Live Demo](https://www.primevue.org/dropdown/)
2023-03-01 10:43:09 +00:00
*
* @module dropdown
*
*/
2023-08-02 14:07:22 +00:00
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
2023-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
2023-09-05 08:50:46 +00:00
import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers';
2023-05-07 20:37:26 +00:00
import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller';
export declare type DropdownPassThroughOptionType<T = any> = DropdownPassThroughAttributes | ((options: DropdownPassThroughMethodOptions<T>) => DropdownPassThroughAttributes | string) | string | null | undefined;
2023-05-07 20:37:26 +00:00
export declare type DropdownPassThroughTransitionType<T = any> = TransitionProps | ((options: DropdownPassThroughMethodOptions<T>) => TransitionProps) | undefined;
2023-08-02 14:07:22 +00:00
2023-05-07 20:37:26 +00:00
/**
* Custom passthrough(pt) option method.
*/
export interface DropdownPassThroughMethodOptions<T> {
/**
* Defines instance.
*/
2023-07-06 12:01:33 +00:00
instance: any;
/**
* Defines valid properties.
*/
2023-05-07 20:37:26 +00:00
props: DropdownProps;
/**
* Defines current inline state.
*/
2023-05-07 20:37:26 +00:00
state: DropdownState;
/**
* Defines parent instance.
*/
parent: T | any;
/**
* Defines current options.
*/
2023-05-07 20:37:26 +00:00
context: DropdownContext;
2023-09-05 08:50:46 +00:00
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
2023-05-07 20:37:26 +00:00
}
2022-09-06 12:03:37 +00:00
2023-03-01 10:43:09 +00:00
/**
* Custom change event.
2023-03-06 20:35:39 +00:00
* @see {@link DropdownEmits.change}
2023-03-01 10:43:09 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface DropdownChangeEvent {
/**
* Browser event.
*/
originalEvent: Event;
/**
* Selected option value
*/
value: any;
}
2023-03-01 10:43:09 +00:00
/**
2023-03-03 14:17:03 +00:00
* Custom filter event.
2023-03-06 20:35:39 +00:00
* @see {@link DropdownEmits.filter}
2023-03-01 10:43:09 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface DropdownFilterEvent {
/**
* Browser event.
*/
originalEvent: Event;
/**
* Filter value
*/
value: any;
}
2023-05-07 20:37:26 +00:00
/**
* Custom passthrough(pt) options.
* @see {@link DropdownProps.pt}
*/
export interface DropdownPassThroughOptions<T = any> {
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the root's DOM element.
2023-05-07 20:37:26 +00:00
*/
root?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the input's DOM element.
2023-05-07 20:37:26 +00:00
*/
input?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the clear icon's DOM element.
2023-05-07 20:37:26 +00:00
*/
clearIcon?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the trigger' DOM element.
2023-05-07 20:37:26 +00:00
*/
trigger?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the loading icon's DOM element.
2023-05-07 20:37:26 +00:00
*/
loadingIcon?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the panel's DOM element.
2023-05-07 20:37:26 +00:00
*/
panel?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header's DOM element.
2023-05-07 20:37:26 +00:00
*/
header?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the filter container's DOM element.
2023-05-07 20:37:26 +00:00
*/
filterContainer?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the filter input's DOM element.
2023-05-07 20:37:26 +00:00
*/
filterInput?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the filter icon's DOM element.
2023-05-07 20:37:26 +00:00
*/
filterIcon?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the wrapper's DOM element.
2023-05-07 20:37:26 +00:00
*/
wrapper?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the VirtualScroller component.
2023-05-07 20:37:26 +00:00
* @see {@link VirtualScrollerPassThroughOptionType}
*/
virtualScroller?: VirtualScrollerPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the list's DOM element.
2023-05-07 20:37:26 +00:00
*/
list?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the item group's DOM element.
2023-05-07 20:37:26 +00:00
*/
itemGroup?: DropdownPassThroughOptionType<T>;
2024-01-24 10:50:41 +00:00
/**
* Used to pass attributes to the item group label's DOM element.
*/
itemGroupLabel?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the item's DOM element.
2023-05-07 20:37:26 +00:00
*/
item?: DropdownPassThroughOptionType<T>;
/**
* Used to pass attributes to the item label's DOM element.
*/
itemLabel?: DropdownPassThroughOptionType<T>;
/**
2024-01-24 12:30:47 +00:00
* Used to pass attributes to the check icon's DOM element.
*/
2024-01-24 12:30:47 +00:00
checkIcon?: DropdownPassThroughOptionType<T>;
/**
* Used to pass attributes to the bank icon's DOM element.
*/
blankIcon?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the empty message's DOM element.
2023-05-07 20:37:26 +00:00
*/
emptyMessage?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden first focusable element's DOM element.
2023-05-07 20:37:26 +00:00
*/
hiddenFirstFocusableEl?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden filter result's DOM element.
2023-05-07 20:37:26 +00:00
*/
hiddenFilterResult?: DropdownPassThroughOptionType<T>;
2023-05-23 09:13:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden empty message's DOM element.
2023-05-23 09:13:26 +00:00
*/
hiddenEmptyMessage?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden selected message's DOM element.
2023-05-07 20:37:26 +00:00
*/
hiddenSelectedMessage?: DropdownPassThroughOptionType<T>;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden last focusable element's DOM element.
2023-05-07 20:37:26 +00:00
*/
hiddenLastFocusableEl?: DropdownPassThroughOptionType<T>;
2023-07-06 11:09:01 +00:00
/**
2023-11-07 06:16:39 +00:00
* Used to manage all lifecycle hooks.
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
2023-08-02 12:00:49 +00:00
/**
* Used to control Vue Transition API.
*/
2023-08-02 14:07:22 +00:00
transition?: DropdownPassThroughTransitionType;
2023-05-07 20:37:26 +00:00
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface DropdownPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in Dropdown component.
*/
export interface DropdownState {
/**
* Current id state as a string.
*/
id: string;
/**
* Current focused state as a boolean.
* @defaultValue false
*/
focused: boolean;
/**
* Current focused item index as a number.
* @defaultvalue -1
*/
focusedOptionIndex: number;
/**
* Current filter value state as a string.
*/
filterValue: string;
/**
* Current overlay visible state as a boolean.
* @defaultValue false
*/
overlayVisible: boolean;
}
/**
* Defines current options in Dropdown component.
*/
export interface DropdownContext {
/**
* Current selection state of the item as a boolean.
* @defaultValue false
*/
selected: boolean;
/**
* Current focus state of the item as a boolean.
* @defaultValue false
*/
focused: boolean;
/**
* Current disabled state of the item as a boolean.
* @defaultValue false
*/
disabled: boolean;
}
2023-03-01 10:43:09 +00:00
/**
* Defines valid properties in Dropdown component.
*/
2022-09-06 12:03:37 +00:00
export interface DropdownProps {
/**
* Value of the component.
*/
modelValue?: any;
/**
* An array of selectitems to display as the available options.
*/
options?: any[];
/**
* Property name or getter function to use as the label of an option.
*/
2023-03-01 10:43:09 +00:00
optionLabel?: string | ((data: any) => string) | undefined;
2022-09-06 12:03:37 +00:00
/**
* Property name or getter function to use as the value of an option, defaults to the option itself when not defined.
*/
2023-03-01 10:43:09 +00:00
optionValue?: string | ((data: any) => any) | undefined;
2022-09-06 12:03:37 +00:00
/**
* Property name or getter function to use as the disabled flag of an option, defaults to false when not defined.
*/
2023-03-01 10:43:09 +00:00
optionDisabled?: string | ((data: any) => boolean) | undefined;
2022-09-06 12:03:37 +00:00
/**
* Property name or getter function to use as the label of an option group.
*/
2023-03-01 10:43:09 +00:00
optionGroupLabel?: string | ((data: any) => string) | undefined;
2022-09-06 12:03:37 +00:00
/**
* Property name or getter function that refers to the children options of option group.
*/
2023-03-01 10:43:09 +00:00
optionGroupChildren?: string | ((data: any) => any[]) | undefined;
2022-09-06 12:03:37 +00:00
/**
* Height of the viewport, a scrollbar is defined if height of list exceeds this value.
2023-03-08 10:51:52 +00:00
* @defaultValue 200px
2022-09-06 12:03:37 +00:00
*/
scrollHeight?: string | undefined;
/**
* When specified, displays a filter input at header.
2023-03-10 14:00:58 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
filter?: boolean | undefined;
/**
* Placeholder text to show when filter input is empty.
*/
filterPlaceholder?: string | undefined;
/**
* Locale to use in filtering. The default locale is the host environment's current locale.
*/
filterLocale?: string | undefined;
/**
* Defines the filtering algorithm to use when searching the options.
2023-03-08 10:51:52 +00:00
* @defaultValue contains
2022-09-06 12:03:37 +00:00
*/
filterMatchMode?: HintedString<'contains' | 'startsWith' | 'endsWith'> | undefined;
2022-09-06 12:03:37 +00:00
/**
* Fields used when filtering the options, defaults to optionLabel.
*/
filterFields?: string[] | undefined;
/**
* When present, custom value instead of predefined options can be entered using the editable input field.
2023-03-10 14:00:58 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
editable?: boolean | undefined;
/**
* Default text to display when no option is selected.
*/
placeholder?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
2022-09-06 12:03:37 +00:00
/**
* When present, it specifies that the component should be disabled.
2023-03-10 14:00:58 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
disabled?: boolean | undefined;
2024-01-31 08:02:53 +00:00
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
2022-09-06 12:03:37 +00:00
/**
* A property to uniquely identify an option.
*/
dataKey?: string | undefined;
/**
* When enabled, a clear icon is displayed to clear the value.
2023-03-10 14:00:58 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
showClear?: boolean | undefined;
/**
* Identifier of the underlying input element.
*/
inputId?: string | undefined;
/**
* Inline style of the input field.
*/
inputStyle?: object | undefined;
2022-09-06 12:03:37 +00:00
/**
* Style class of the input field.
*/
inputClass?: string | object | undefined;
2022-09-06 12:03:37 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLInputElement/HTMLSpanElement to the focusable input element inside the component.
2022-09-06 12:03:37 +00:00
*/
inputProps?: InputHTMLAttributes | HTMLAttributes | undefined;
/**
* Inline style of the overlay panel.
*/
panelStyle?: object | undefined;
2022-09-06 12:03:37 +00:00
/**
* Style class of the overlay panel.
*/
panelClass?: string | object | undefined;
2022-09-06 12:03:37 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLDivElement to the overlay panel inside the component.
2022-09-06 12:03:37 +00:00
*/
panelProps?: HTMLAttributes | undefined;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLInputElement to the filter input inside the component.
2022-09-06 12:03:37 +00:00
*/
filterInputProps?: InputHTMLAttributes | undefined;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLElement to the clear icon inside the component.
* @deprecated since v3.26.0. Use 'pt' peroperty.
2022-09-06 12:03:37 +00:00
*/
clearIconProps?: HTMLAttributes | undefined;
/**
2023-03-01 10:43:09 +00:00
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
2023-03-08 10:51:52 +00:00
* @defaultValue body
2022-09-06 12:03:37 +00:00
*/
appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement;
2022-09-06 12:03:37 +00:00
/**
* Whether the dropdown is in loading state.
2023-03-10 14:00:58 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
loading?: boolean | undefined;
2022-12-08 11:04:25 +00:00
/**
* Icon to display in clear button.
* @deprecated since v3.27.0. Use 'clearicon' slot.
2022-12-08 11:04:25 +00:00
*/
clearIcon?: string | undefined;
/**
* Icon to display in the dropdown.
* @deprecated since v3.27.0. Use 'dropdownicon' slot.
2022-12-08 11:04:25 +00:00
*/
dropdownIcon?: string | undefined;
/**
* Icon to display in filter input.
* @deprecated since v3.27.0. Use 'filtericon' slot.
2022-12-08 11:04:25 +00:00
*/
filterIcon?: string | undefined;
2022-09-06 12:03:37 +00:00
/**
* Icon to display in loading state.
* @deprecated since v3.27.0. Use 'loadingicon' slot.
2022-09-06 12:03:37 +00:00
*/
loadingIcon?: string | undefined;
2022-09-14 11:26:01 +00:00
/**
* Clears the filter value when hiding the dropdown.
2023-03-10 14:00:58 +00:00
* @defaultValue false
2022-09-14 11:26:01 +00:00
*/
resetFilterOnHide?: boolean;
/**
* Clears the filter value when clicking on the clear icon.
* @defaultValue false
*/
resetFilterOnClear?: boolean;
2022-09-06 12:03:37 +00:00
/**
* Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.
*/
virtualScrollerOptions?: VirtualScrollerProps;
/**
* Whether to focus on the first visible or selected element when the overlay panel is shown.
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
autoOptionFocus?: boolean | undefined;
2022-09-14 11:26:01 +00:00
/**
* Whether to focus on the filter element when the overlay panel is shown.
2023-03-01 10:43:09 +00:00
* @defaultValue false
2022-09-14 11:26:01 +00:00
*/
autoFilterFocus?: boolean | undefined;
/**
* When enabled, the focused option is selected.
2023-03-01 10:43:09 +00:00
* @defaultValue false
2022-09-14 11:26:01 +00:00
*/
selectOnFocus?: boolean | undefined;
/**
* When enabled, the focus is placed on the hovered option.
* @defaultValue true
*/
focusOnHover?: boolean | undefined;
/**
2024-01-24 10:50:41 +00:00
* Whether the selected option will be add highlight class.
2024-01-24 11:26:29 +00:00
* @defaultValue true
*/
highlightOnSelect?: boolean | undefined;
/**
2024-01-24 12:30:47 +00:00
* Whether the selected option will be shown with a check mark.
2024-01-24 11:26:29 +00:00
* @defaultValue false
*/
2024-01-24 12:30:47 +00:00
checkmark?: boolean | undefined;
2022-09-06 12:03:37 +00:00
/**
* Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration.
2023-03-08 11:02:08 +00:00
* @defaultValue '{0} results are available'
2022-09-06 12:03:37 +00:00
*/
filterMessage?: string | undefined;
/**
* Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration.
2023-03-08 11:02:08 +00:00
* @defaultValue '{0} items selected'
2022-09-06 12:03:37 +00:00
*/
selectionMessage?: string | undefined;
/**
* Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration.
2023-03-08 10:51:52 +00:00
* @defaultValue No selected item
2022-09-06 12:03:37 +00:00
*/
emptySelectionMessage?: string | undefined;
/**
* Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration.
2023-03-08 10:51:52 +00:00
* @defaultValue No results found
2022-09-06 12:03:37 +00:00
*/
emptyFilterMessage?: string | undefined;
/**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* @defaultValue No results found
2022-09-06 12:03:37 +00:00
*/
emptyMessage?: string | undefined;
/**
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
/**
* Defines a string value that labels an interactive element.
*/
2023-11-24 12:21:54 +00:00
ariaLabel?: string | undefined;
2022-09-06 12:03:37 +00:00
/**
* Identifier of the underlying input element.
*/
2023-11-24 12:21:54 +00:00
ariaLabelledby?: string | undefined;
2023-05-07 20:37:26 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-05-07 20:37:26 +00:00
* @type {DropdownPassThroughOptions}
*/
pt?: PassThrough<DropdownPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2023-05-23 09:13:26 +00:00
/**
* When enabled, it removes component related styles in the core.
* @defaultValue false
*/
unstyled?: boolean;
2022-09-06 12:03:37 +00:00
}
2023-03-01 10:43:09 +00:00
/**
* Defines valid slots in Dropdown component.
*/
2022-09-06 12:03:37 +00:00
export interface DropdownSlots {
/**
* Custom value template.
* @param {Object} scope - value slot's params.
*/
2023-03-01 10:43:09 +00:00
value(scope: {
2022-09-06 12:03:37 +00:00
/**
* Value of the component
*/
value: any;
/**
* Placeholder prop value
*/
placeholder: string;
2023-03-01 10:43:09 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom indicator template.
* @deprecated since v3.27.0. Use 'dropdownicon or loadingicon' slots.
2022-09-06 12:03:37 +00:00
*/
2023-03-01 10:43:09 +00:00
indicator(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom header template of panel.
* @param {Object} scope - header slot's params.
*/
2023-03-01 10:43:09 +00:00
header(scope: {
2022-09-06 12:03:37 +00:00
/**
* Value of the component
*/
value: any;
/**
* Displayed options
*/
options: any[];
2023-03-01 10:43:09 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom footer template of panel.
* @param {Object} scope - footer slot's params.
*/
2023-03-01 10:43:09 +00:00
footer(scope: {
2022-09-06 12:03:37 +00:00
/**
* Value of the component
*/
value: any;
/**
* Displayed options
*/
options: any[];
2023-03-01 10:43:09 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom option template.
* @param {Object} scope - option slot's params.
*/
2023-03-01 10:43:09 +00:00
option(scope: {
2022-09-06 12:03:37 +00:00
/**
* Option instance
*/
option: any;
/**
* Index of the option
*/
index: number;
2023-03-01 10:43:09 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom option group template.
* @param {Object} scope - option group slot's params.
*/
2023-03-01 10:43:09 +00:00
optiongroup(scope: {
2022-09-06 12:03:37 +00:00
/**
* Option instance
*/
option: any;
/**
* Index of the option
*/
index: number;
2023-03-01 10:43:09 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom empty filter template.
*/
2023-03-01 10:43:09 +00:00
emptyfilter(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom empty template.
*/
2023-03-01 10:43:09 +00:00
empty(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom content template.
* @param {Object} scope - content slot's params.
*/
2023-03-01 10:43:09 +00:00
content(scope: {
2022-09-06 12:03:37 +00:00
/**
* An array of objects to display for virtualscroller
*/
items: any;
/**
* Style class of the component
*/
styleClass: string;
/**
* Referance of the content
* @param {HTMLElement} el - Element of 'ref' property
*/
2023-08-17 07:16:25 +00:00
contentRef: (el: any) => void;
2022-09-06 12:03:37 +00:00
/**
* Options of the items
* @param {number} index - Rendered index
2023-08-17 07:16:25 +00:00
* @return {@link VirtualScrollerItemOptions}
2022-09-06 12:03:37 +00:00
*/
2023-08-17 07:16:25 +00:00
getItemOptions: (index: number) => VirtualScrollerItemOptions;
2023-03-01 10:43:09 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom loader template.
* @param {Object} scope - loader slot's params.
*/
2023-03-01 10:43:09 +00:00
loader(scope: {
2022-09-06 12:03:37 +00:00
/**
* Options of the loader items for virtualscroller
*/
options: any[];
2023-03-01 10:43:09 +00:00
}): VNode[];
/**
* Custom clear icon template.
* @param {Object} scope - clear icon slot's params.
*/
clearicon(scope: {
/**
* Style class of the clear icon
*/
class: any;
/**
* Clear icon click function.
2023-08-15 16:00:19 +00:00
* @param {Event} event - Browser event
2023-10-31 17:21:47 +00:00
* @deprecated since v3.39.0. Use 'clearCallback' property instead.
*/
2023-08-17 07:16:25 +00:00
onClick: (event: Event) => void;
2023-10-31 17:21:47 +00:00
/**
* Clear icon click function.
* @param {Event} event - Browser event
*/
clearCallback: (event: Event) => void;
}): VNode[];
/**
* Custom dropdown icon template.
* @param {Object} scope - dropdown icon slot's params.
*/
dropdownicon(scope: {
/**
* Style class of the dropdown icon
*/
class: any;
}): VNode[];
/**
* Custom loading icon template.
* @param {Object} scope - loading icon slot's params.
*/
loadingicon(scope: {
/**
* Style class of the loading icon
*/
class: any;
}): VNode[];
/**
* Custom filter icon template.
* @param {Object} scope - filter icon slot's params.
*/
filtericon(scope: {
/**
* Style class of the filter icon
*/
class: any;
}): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 10:43:09 +00:00
/**
* Defines valid emits in Dropdown component.
*/
export interface DropdownEmits {
2022-09-06 12:03:37 +00:00
/**
* Emitted when the value changes.
* @param {*} value - New value.
*/
2023-03-01 10:43:09 +00:00
'update:modelValue'(value: any): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke on value change.
* @param {DropdownChangeEvent} event - Custom change event.
*/
2023-03-01 10:43:09 +00:00
change(event: DropdownChangeEvent): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
*/
2023-03-01 10:43:09 +00:00
focus(event: Event): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
*/
2023-03-01 10:43:09 +00:00
blur(event: Event): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke before the overlay is shown.
*/
2023-03-01 10:43:09 +00:00
'before-show'(): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke before the overlay is hidden.
*/
2023-03-01 10:43:09 +00:00
'before-hide'(): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when the overlay is shown.
*/
2023-03-01 10:43:09 +00:00
show(): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when the overlay is hidden.
*/
2023-03-01 10:43:09 +00:00
hide(): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke on filter input.
* @param {DropdownFilterEvent} event - Custom filter event.
*/
2023-03-01 10:43:09 +00:00
filter(event: DropdownFilterEvent): void;
}
2022-09-06 12:03:37 +00:00
2023-03-01 10:43:09 +00:00
/**
* **PrimeVue - Dropdown**
*
* _Dropdown also known as Select, is used to choose an item from a collection of options._
*
* [Live Demo](https://www.primevue.org/dropdown/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
*
* @group Component
*/
2023-03-01 14:48:23 +00:00
declare class Dropdown extends ClassComponent<DropdownProps, DropdownSlots, DropdownEmits> {
2022-09-06 12:03:37 +00:00
/**
* Shows the overlay.
2023-03-01 10:43:09 +00:00
* @param {boolean} [isFocus] - Decides whether to focus on the component. @defaultValue false.
2022-09-06 12:03:37 +00:00
*
* @memberof Dropdown
*/
show: (isFocus?: boolean) => void;
/**
* Hides the overlay.
2023-03-01 10:43:09 +00:00
* @param {boolean} [isFocus] - Decides whether to focus on the component. @defaultValue false.
2022-09-06 12:03:37 +00:00
*
* @memberof Dropdown
*/
hide: (isFocus?: boolean) => void;
}
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Dropdown: GlobalComponentConstructor<Dropdown>;
2022-09-06 12:03:37 +00:00
}
}
export default Dropdown;