primevue-mirror/components/lib/multiselect/MultiSelect.d.ts

867 lines
24 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
*
*/
2023-08-02 14:07:22 +00:00
import { ButtonHTMLAttributes, 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 } from '../ts-helpers';
2023-05-08 07:00:16 +00:00
import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller';
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
2023-03-01 10:58:06 +00:00
/**
* Custom change event.
* @see {@link MultiSelectEmits.change}
*/
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.
2023-03-01 11:03:53 +00:00
* @see {@link MultiSelectEmits['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
* @see {@link MultiSelectEmits.filter}
*/
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 {
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the root's DOM element.
2023-05-08 07:00:16 +00:00
*/
root?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the label container's DOM element.
2023-05-08 07:00:16 +00:00
*/
labelContainer?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the label's DOM element.
2023-05-08 07:00:16 +00:00
*/
label?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the token's DOM element.
2023-05-08 07:00:16 +00:00
*/
token?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the token label's DOM element.
2023-05-08 07:00:16 +00:00
*/
tokenLabel?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the remove token icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
removeTokenIcon?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the trigger's DOM element.
2023-05-08 07:00:16 +00:00
*/
trigger?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the trigger icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
triggerIcon?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the dropdown icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
dropdownIcon?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the panel's DOM element.
2023-05-08 07:00:16 +00:00
*/
panel?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header's DOM element.
2023-05-08 07:00:16 +00:00
*/
header?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header checkbox's DOM element.
2023-05-08 07:00:16 +00:00
*/
headerCheckbox?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the filter container's DOM element.
2023-05-08 07:00:16 +00:00
*/
filterContainer?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the filter input's DOM element.
2023-05-08 07:00:16 +00:00
*/
filterInput?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the filter icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
filterIcon?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the close button's DOM element.
2023-05-08 07:00:16 +00:00
*/
closeButton?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the close icon's DOM element.
2023-05-08 07:00:16 +00:00
*/
closeIcon?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the wrapper's DOM element.
2023-05-08 07:00:16 +00:00
*/
wrapper?: MultiSelectPassThroughOptionType;
/**
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;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the list's DOM element.
2023-05-08 07:00:16 +00:00
*/
list?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the item group's DOM element.
2023-05-08 07:00:16 +00:00
*/
itemGroup?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the item's DOM element.
2023-05-08 07:00:16 +00:00
*/
item?: MultiSelectPassThroughOptionType;
/**
2024-01-14 13:38:51 +00:00
* Used to pass attributes to the item checkbox's DOM element.
2023-05-08 07:00:16 +00:00
*/
2024-01-14 13:38:51 +00:00
itemCheckbox?: MultiSelectPassThroughOptionType;
2023-05-08 07:00:16 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the option's DOM element.
2023-05-08 07:00:16 +00:00
*/
option?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the emptyMessage's DOM element.
2023-05-08 07:00:16 +00:00
*/
emptyMessage?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden input's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenInput?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +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;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden filter result's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenFilterResult?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the hidden selected message's DOM element.
2023-05-08 07:00:16 +00:00
*/
hiddenSelectedMessage?: MultiSelectPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* 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.
* @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 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;
/**
* An array of selectitems to display as the available options.
*/
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.
2023-03-08 10:51:52 +00:00
* @defaultValue 200px
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;
/**
* Identifier of the underlying input element.
*/
inputId?: string | undefined;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLInputElement to the focusable input element inside the component.
2022-09-06 12:03:37 +00:00
*/
inputProps?: InputHTMLAttributes | undefined;
/**
* Inline style of the overlay panel.
*/
panelStyle?: any;
/**
* Style class of the overlay panel.
*/
panelClass?: any;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLDivElement to the overlay panel.
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 overlay panel.
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 HTMLButtonElement to the clear button inside the overlay panel.
2022-09-06 12:03:37 +00:00
*/
closeButtonProps?: ButtonHTMLAttributes | undefined;
/**
* 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
*/
2023-03-27 08:09:36 +00:00
filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | string | 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
*/
2023-03-01 10:58:06 +00:00
appendTo?: 'body' | 'self' | string | 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.
* @deprecated since v3.27.0. Use 'checkboxicon' slot.
2022-12-08 11:04:25 +00:00
*/
checkboxIcon?: string | undefined;
/**
* Icon to display in the dropdown close button.
* @deprecated since v3.27.0. Use 'closeicon' slot.
2022-12-08 11:04:25 +00:00
*/
closeIcon?: 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-12-08 11:04:25 +00:00
/**
* Icon to display in chip remove action.
* @deprecated since v3.27.0. Use 'removetokenicon' slot.
2022-12-08 11:04:25 +00:00
*/
removeTokenIcon?: 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.
2023-03-08 10:51:52 +00:00
* @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-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 indicator template.
* @deprecated since v3.27.0. Use 'loadingicon and dropdownicon' slot.
2022-09-06 12:03:37 +00:00
*/
2023-03-01 10:58:06 +00:00
indicator(): 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;
/**
* 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[];
/**
* Custom remove token 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;
/**
* Remove token icon function.
2023-08-16 06:40:20 +00:00
* @param {Event} event - Browser event
* @param {any} item - Item
2023-10-31 17:21:47 +00:00
* @deprecated since v3.39.0. Use 'removeCallback' property instead.
*/
2023-08-17 07:16:25 +00:00
onClick: (event: Event, item: any) => void;
2023-10-31 17:21:47 +00:00
/**
* Remove token icon function.
* @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.
*/
export interface MultiSelectEmits {
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
2023-03-01 10:58:06 +00:00
/**
* **PrimeVue - MultiSelect**
*
* _MultiSelect is used to select multiple items from a collection._
*
* [Live Demo](https://www.primevue.org/multiselect/)
* --- ---
2023-03-03 10:55:20 +00:00
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
2023-03-01 10:58:06 +00:00
*
* @group Component
*
*/
2022-09-06 12:03:37 +00:00
declare class MultiSelect extends ClassComponent<MultiSelectProps, MultiSelectSlots, MultiSelectEmits> {
/**
* 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
}
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
MultiSelect: GlobalComponentConstructor<MultiSelect>;
2022-09-06 12:03:37 +00:00
}
}
export default MultiSelect;