primevue-mirror/packages/primevue/src/multiselect/MultiSelect.d.ts

912 lines
25 KiB
TypeScript
Raw Normal View History

2023-03-01 10:58:06 +00:00
/**
*
* MultiSelect is used to select multiple items from a collection.
*
* [Live Demo](https://www.primevue.org/multiselect/)
*
* @module multiselect
*
*/
2024-06-11 23:08:08 +00:00
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, HintedString, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { ChipPassThroughOptions } from 'primevue/chip';
import type { IconFieldPassThroughOptions } from 'primevue/iconfield';
import type { InputIconPassThroughOptions } from 'primevue/inputicon';
import type { InputTextPassThroughOptions } from 'primevue/inputtext';
import type { PassThroughOptions } from 'primevue/passthrough';
import type { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from 'primevue/virtualscroller';
2024-03-19 14:14:13 +00:00
import { TransitionProps, VNode } from 'vue';
2023-05-08 07:00:16 +00:00
export declare type MultiSelectPassThroughOptionType = MultiSelectPassThroughAttributes | ((options: MultiSelectPassThroughMethodOptions) => MultiSelectPassThroughAttributes | string) | string | null | undefined;
2023-05-08 07:00:16 +00:00
2023-08-02 14:07:22 +00:00
export declare type MultiSelectPassThroughTransitionType = TransitionProps | ((options: MultiSelectPassThroughMethodOptions) => TransitionProps) | undefined;
2023-05-08 07:00:16 +00:00
/**
* Custom passthrough(pt) option method.
*/
export interface MultiSelectPassThroughMethodOptions {
/**
* Defines instance.
*/
2023-07-06 12:01:33 +00:00
instance: any;
/**
* Defines valid properties.
*/
2023-05-08 07:00:16 +00:00
props: MultiSelectProps;
/**
* Defines current inline state.
*/
2023-05-08 07:00:16 +00:00
state: MultiSelectState;
/**
* Defines current options.
*/
2023-05-08 07:00:16 +00:00
context: MultiSelectContext;
/**
* Defines valid attributes.
*/
attrs: any;
/**
* Defines parent options.
*/
parent: any;
2023-09-05 08:50:46 +00:00
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
2023-05-08 07:00:16 +00:00
}
2022-09-06 12:03:37 +00:00
2024-03-18 10:02:32 +00:00
/**
* Custom shared passthrough(pt) option method.
*/
export interface MultiSelectSharedPassThroughMethodOptions {
/**
* Defines valid properties.
*/
props: MultiSelectProps;
/**
* Defines current inline state.
*/
state: MultiSelectState;
}
2023-03-01 10:58:06 +00:00
/**
* Custom change event.
2024-05-16 14:05:43 +00:00
* @see {@link MultiSelectEmitsOptions.change}
2023-03-01 10:58:06 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface MultiSelectChangeEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Selected option value
*/
value: any;
}
2023-03-01 10:58:06 +00:00
/**
* Custom all change event.
2024-05-16 14:05:43 +00:00
* @see {@link MultiSelectEmitsOptions['selectall-change']}
2023-03-01 10:58:06 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface MultiSelectAllChangeEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Whether all data is selected.
*/
checked: boolean;
}
2023-03-01 10:58:06 +00:00
/**
* Custom filter event
2024-05-16 14:05:43 +00:00
* @see {@link MultiSelectEmitsOptions.filter}
2023-03-01 10:58:06 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface MultiSelectFilterEvent {
/**
* Original event
*/
originalEvent: Event;
/**
* Filter value
*/
value: string;
}
2023-05-08 07:00:16 +00:00
/**
* Custom passthrough(pt) options.
* @see {@link MultiSelectProps.pt}
*/
export interface MultiSelectPassThroughOptions {
/**
* Used to pass attributes to the root's DOM element.
2023-05-08 07:00:16 +00:00
*/
root?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the label container's DOM element.
2023-05-08 07:00:16 +00:00
*/
labelContainer?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the label's DOM element.
2023-05-08 07:00:16 +00:00
*/
label?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the chip's DOM element.
2023-05-08 07:00:16 +00:00
*/
2024-05-15 07:35:36 +00:00
chipItem?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
2024-04-08 12:21:00 +00:00
* Used to pass attributes to the Chip.
* @see {@link ChipPassThroughOptions}
2023-05-08 07:00:16 +00:00
*/
2024-05-15 07:35:36 +00:00
pcChip?: ChipPassThroughOptions<MultiSelectSharedPassThroughMethodOptions>;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the chip icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
chipIcon?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the dropdown's DOM element.
2023-05-08 07:00:16 +00:00
*/
dropdown?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the loading icon's DOM element.
*/
loadingIcon?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the dropdown icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
dropdownIcon?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the overlay's DOM element.
2023-05-08 07:00:16 +00:00
*/
overlay?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the header's DOM element.
2023-05-08 07:00:16 +00:00
*/
header?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the header checkbox's DOM element.
2023-05-08 07:00:16 +00:00
*/
2024-05-06 15:23:01 +00:00
pcHeaderCheckbox?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
2024-05-09 06:35:19 +00:00
* Used to pass attributes to the IconField component.
* @see {@link IconFieldPassThroughOptions}
2023-05-08 07:00:16 +00:00
*/
2024-05-09 06:35:19 +00:00
pcFilterContainer?: IconFieldPassThroughOptions<MultiSelectSharedPassThroughMethodOptions>;
2023-05-08 07:00:16 +00:00
/**
2024-03-18 10:02:32 +00:00
* Used to pass attributes to the InputText component.
* @see {@link InputTextPassThroughOptions}
2023-05-08 07:00:16 +00:00
*/
2024-05-06 15:23:01 +00:00
pcFilter?: InputTextPassThroughOptions<MultiSelectSharedPassThroughMethodOptions>;
2024-05-09 06:35:19 +00:00
/**
* Used to pass attributes to the InputIcon component.
* @see {@link InputIconPassThroughOptions}
*/
pcFilterIconContainer?: InputIconPassThroughOptions<MultiSelectSharedPassThroughMethodOptions>;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the filter icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
filterIcon?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the list container's DOM element.
2023-05-08 07:00:16 +00:00
*/
listContainer?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the VirtualScroller component.
2023-05-08 07:00:16 +00:00
* @see {@link VirtualScrollerPassThroughOptionType}
*/
virtualScroller?: VirtualScrollerPassThroughOptionType;
/**
* Used to pass attributes to the list's DOM element.
2023-05-08 07:00:16 +00:00
*/
list?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the option group's DOM element.
2023-05-08 07:00:16 +00:00
*/
optionGroup?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the option's DOM element.
2023-05-08 07:00:16 +00:00
*/
option?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the option label's DOM element.
2023-05-08 07:00:16 +00:00
*/
optionLabel?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the option checkbox's DOM element.
2023-05-08 07:00:16 +00:00
*/
2024-05-06 15:23:01 +00:00
pcOptionCheckbox?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the emptyMessage's DOM element.
2023-05-08 07:00:16 +00:00
*/
emptyMessage?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the hidden input container's DOM element.
2023-05-08 07:00:16 +00:00
*/
2024-05-06 15:32:04 +00:00
hiddenInputContainer?: MultiSelectPassThroughOptionType;
2024-07-09 07:46:56 +00:00
/**
* Used to pass attributes to the hidden input's DOM element.
*/
hiddenInput?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
* Used to pass attributes to the hidden first focusable element's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenFirstFocusableEl?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the hidden filter result's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenFilterResult?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the hidden selected message's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenSelectedMessage?: MultiSelectPassThroughOptionType;
/**
* Used to pass attributes to the hidden last focusable element's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenLastFocusableEl?: MultiSelectPassThroughOptionType;
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:01:41 +00:00
/**
* Used to control Vue Transition API.
*/
2023-08-02 14:07:22 +00:00
transition?: MultiSelectPassThroughTransitionType;
2023-05-08 07:00:16 +00:00
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface MultiSelectPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in MultiSelect component.
*/
export interface MultiSelectState {
/**
* 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.
2024-03-18 10:02:32 +00:00
* @defaultValue -1
2023-05-08 07:00:16 +00:00
*/
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 MultiSelect component.
*/
export interface MultiSelectContext {
/**
* 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:58:06 +00:00
/**
* Defines valid properties in MultiSelect component.
*/
2022-09-06 12:03:37 +00:00
export interface MultiSelectProps {
/**
* Value of the component.
*/
modelValue?: any;
/**
2024-03-18 10:02:32 +00:00
* An array of select items to display as the available options.
2022-09-06 12:03:37 +00:00
*/
options?: any[] | undefined;
/**
* Property name or getter function to use as the label of an option.
*/
2023-03-01 10:58:06 +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:58:06 +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:58:06 +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:58:06 +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:58:06 +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.
2024-03-26 14:21:39 +00:00
* @defaultValue 14rem
2022-09-06 12:03:37 +00:00
*/
scrollHeight?: string | undefined;
/**
* Label to display when there are no selections.
*/
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-01 10:58:06 +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;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
2022-09-06 12:03:37 +00:00
/**
* Identifier of the underlying input element.
*/
inputId?: string | undefined;
/**
* @deprecated since v4.0. Use 'overlayStyle' instead.
* Inline style of the overlay.
2022-09-06 12:03:37 +00:00
*/
panelStyle?: any;
/**
* @deprecated since v4.0. Use 'overlayClass' instead.
* Style class of the overlay.
2022-09-06 12:03:37 +00:00
*/
panelClass?: any;
/**
* Inline style of the overlay.
*/
overlayStyle?: any;
/**
* Style class of the overlay.
*/
overlayClass?: any;
2022-09-06 12:03:37 +00:00
/**
* A property to uniquely identify an option.
*/
dataKey?: string | undefined;
/**
* When specified, displays a filter input at header.
2023-03-01 10:58:06 +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;
/**
* A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself.
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
/**
* Defines how the selected items are displayed.
2023-03-08 10:51:52 +00:00
* @defaultValue comma
2022-09-06 12:03:37 +00:00
*/
2023-03-01 10:58:06 +00:00
display?: 'comma' | 'chip' | undefined;
2022-09-06 12:03:37 +00:00
/**
* Label to display after exceeding max selected labels.
2023-03-08 11:02:08 +00:00
* @defaultValue '{0} items selected'
2022-09-06 12:03:37 +00:00
*/
selectedItemsLabel?: string | undefined;
/**
* Decides how many selected item labels to show at most.
*/
maxSelectedLabels?: number | undefined;
/**
* Maximum number of selectable items.
*/
selectionLimit?: number | undefined;
/**
* Whether to show the header checkbox to toggle the selection of all items at once.
2023-03-01 10:58:06 +00:00
* @defaultValue true
2022-09-06 12:03:37 +00:00
*/
showToggleAll?: boolean | undefined;
/**
* Whether the multiselect is in loading state.
2023-03-01 10:58:06 +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 the checkboxes.
*/
checkboxIcon?: string | undefined;
/**
* Icon to display in the dropdown close button.
*/
closeIcon?: string | undefined;
/**
* Icon to display in the dropdown.
*/
dropdownIcon?: string | undefined;
/**
* Icon to display in filter input.
*/
filterIcon?: string | undefined;
2022-09-06 12:03:37 +00:00
/**
* Icon to display in loading state.
*/
loadingIcon?: string | undefined;
2022-12-08 11:04:25 +00:00
/**
* Icon to display in chip remove action.
*/
removeTokenIcon?: string | undefined;
/**
* Icon to display in chip remove action.
*/
chipIcon?: string | undefined;
2022-09-06 12:03:37 +00:00
/**
* Whether all data is selected.
2023-03-01 10:58:06 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
selectAll?: boolean | undefined;
/**
* Clears the filter value when hiding the dropdown.
2023-03-01 10:58:06 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
2023-03-01 10:58:06 +00:00
resetFilterOnHide?: boolean | undefined;
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.
2023-03-01 10:58:06 +00:00
* @type {VirtualScrollerProps}
2022-09-06 12:03:37 +00:00
*/
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:58:06 +00:00
* @defaultValue false
2022-09-14 11:26:01 +00:00
*/
autoFilterFocus?: boolean | undefined;
/**
* When enabled, the focus is placed on the hovered option.
* @defaultValue true
*/
focusOnHover?: boolean | undefined;
2024-01-18 13:11:07 +00:00
/**
* Highlights automatically the first item.
* @defaultValue false
*/
highlightOnSelect?: 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.
2024-06-12 14:55:24 +00:00
* @defaultValue No available options'
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;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
dt?: DesignToken<any>;
2023-05-08 07:00:16 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-05-08 07:00:16 +00:00
* @type {MultiSelectPassThroughOptions}
*/
pt?: PassThrough<MultiSelectPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2023-05-25 14:01:28 +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:58:06 +00:00
/**
* Defines valid slots in MultiSelect component.
*/
2022-09-06 12:03:37 +00:00
export interface MultiSelectSlots {
/**
* Custom value template.
* @param {Object} scope - value slot's params.
*/
2023-03-01 10:58:06 +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:58:06 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom chip template.
* @param {Object} scope - chip slot's params.
*/
2023-03-01 10:58:06 +00:00
chip(scope: {
2022-09-06 12:03:37 +00:00
/**
* A value in the selection
*/
value: any;
2023-03-01 10:58:06 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom header template.
* @param {Object} scope - header slot's params.
*/
2023-03-01 10:58:06 +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:58:06 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom footer template.
* @param {Object} scope - footer slot's params.
*/
2023-03-01 10:58:06 +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:58:06 +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:58:06 +00:00
option(scope: {
2022-09-06 12:03:37 +00:00
/**
* Option instance
*/
option: any;
/**
* Selection state
*/
selected: boolean;
2022-09-06 12:03:37 +00:00
/**
* Index of the option
*/
index: number;
2023-03-01 10:58:06 +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:58:06 +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:58:06 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom emptyfilter template.
*/
2023-03-01 10:58:06 +00:00
emptyfilter(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom empty template.
*/
2023-03-01 10:58:06 +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:58:06 +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-03-01 10:58:06 +00:00
* @return {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:58:06 +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:58:06 +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:58:06 +00:00
}): VNode[];
/**
* @deprecated since v4.0. Use 'chipicon' slot instead.
* Custom chip icon template.
2023-08-17 07:16:25 +00:00
* @param {Object} scope - removetokenicon slot's params.
*/
removetokenicon(scope: {
/**
* Style class of the loading icon.
*/
class: string;
2023-08-16 06:40:20 +00:00
/**
* Item of the token.
*/
item: any;
/**
* Chip icon function.
* @param {Event} event - Browser event
* @param {any} item - Item
*/
removeCallback: (event: Event, item: any) => void;
}): VNode[];
/**
* Custom chip icon template.
* @param {Object} scope - chipicon slot's params.
*/
chipicon(scope: {
/**
* Style class of the loading icon.
*/
class: string;
/**
* Item of the token.
*/
item: any;
2023-10-31 17:21:47 +00:00
/**
* Chip icon function.
2023-10-31 17:21:47 +00:00
* @param {Event} event - Browser event
* @param {any} item - Item
*/
removeCallback: (event: Event, item: any) => void;
}): VNode[];
/**
* Custom header checkbox icon template.
* @param {Object} scope - header checkbox icon slot's params.
*/
headercheckboxicon(scope: {
/**
* Options of the loader items for virtualscroller
*/
allSelected: boolean;
/**
* Style class of the loading icon.
*/
class: string;
}): VNode[];
/**
* Custom filter icon template.
2023-08-17 07:16:25 +00:00
* @param {Object} scope - filtericon slot's params.
*/
filtericon(scope: {
/**
* Style class of the loading icon.
*/
class: string;
}): VNode[];
/**
* Custom close icon template.
2023-08-17 07:16:25 +00:00
* @param {Object} scope - closeicon slot's params.
*/
closeicon(scope: {
/**
* Style class of the loading icon.
*/
class: string;
}): VNode[];
/**
* Custom item checkbox icon template.
2023-08-17 07:16:25 +00:00
* @param {Object} scope - itemcheckboxicon slot's params.
*/
itemcheckboxicon(scope: {
/**
* Options of the loader items for virtualscroller
*/
selected: boolean;
/**
* Style class of the loading icon.
*/
class: string;
}): VNode[];
/**
* Custom loading icon template.
* @param {Object} scope - loading icon slot's params.
*/
loadingicon(scope: {
/**
* Style class of the loading icon.
*/
class: string;
}): VNode[];
/**
* Custom dropdown icon template.
2023-08-17 07:16:25 +00:00
* @param {Object} scope - dropdownicon slot's params.
*/
dropdownicon(scope: {
/**
* Style class of the loading icon.
*/
class: string;
}): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 10:58:06 +00:00
/**
* Defines valid emits in MultiSelect component.
*/
2024-05-16 14:05:43 +00:00
export interface MultiSelectEmitsOptions {
2022-09-06 12:03:37 +00:00
/**
* Emitted when the value changes.
* @param {*} value - New value.
*/
2023-03-01 10:58:06 +00:00
'update:modelValue'(value: any): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke on value change.
* @param {MultiSelectChangeEvent} event - Custom change event.
*/
2023-03-01 10:58:06 +00:00
change(event: MultiSelectChangeEvent): 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:58:06 +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:58:06 +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:58:06 +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:58:06 +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:58:06 +00:00
show(): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when the overlay is hidden.
*/
2023-03-01 10:58:06 +00:00
hide(): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke on filter input.
* @param {MultiSelectFilterEvent} event - Custom filter event.
*/
2023-03-01 10:58:06 +00:00
filter(event: MultiSelectFilterEvent): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when all data is selected.
* @param {MultiSelectAllChangeEvent} event - Custom select all change event.
*/
2023-03-01 10:58:06 +00:00
'selectall-change'(event: MultiSelectAllChangeEvent): void;
}
2022-09-06 12:03:37 +00:00
export declare type MultiSelectEmits = EmitFn<MultiSelectEmitsOptions>;
export interface MultiSelectMethods {
2022-09-06 12:03:37 +00:00
/**
* Shows the overlay.
* @param {boolean} [isFocus] - Decides whether to focus on the component. Default value is false.
*
* @memberof MultiSelect
*/
2023-03-01 10:58:06 +00:00
show(isFocus?: boolean): void;
2022-09-06 12:03:37 +00:00
/**
* Hides the overlay.
* @param {boolean} [isFocus] - Decides whether to focus on the component. Default value is false.
*
* @memberof MultiSelect
*/
2023-03-01 10:58:06 +00:00
hide(isFocus?: boolean): void;
2022-09-06 12:03:37 +00:00
}
/**
* **PrimeVue - MultiSelect**
*
* _MultiSelect is used to select multiple items from a collection._
*
* [Live Demo](https://www.primevue.org/multiselect/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
*
* @group Component
*
*/
declare const MultiSelect: DefineComponent<MultiSelectProps, MultiSelectSlots, MultiSelectEmits>;
declare module 'vue' {
export interface GlobalComponents {
MultiSelect: GlobalComponentConstructor<MultiSelectProps, MultiSelectSlots, MultiSelectEmits>;
2022-09-06 12:03:37 +00:00
}
}
export default MultiSelect;