Fixed #2822 - Improve AutoComplete implementation for Accessibility
parent
31148c1a9a
commit
61f50c897e
|
@ -17,6 +17,18 @@ const AutoCompleteProps = [
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Property name or getter function of a suggested object to resolve and display."
|
description: "Property name or getter function of a suggested object to resolve and display."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "optionLabel",
|
||||||
|
type: "string | function",
|
||||||
|
default: "null",
|
||||||
|
description: "Property name or getter function to use as the label of an option."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "optionDisabled",
|
||||||
|
type: "boolean",
|
||||||
|
default: "null",
|
||||||
|
description: "Property name or getter function to use as the disabled flag of an option, defaults to false when not defined."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "optionGroupLabel",
|
name: "optionGroupLabel",
|
||||||
type: "string",
|
type: "string",
|
||||||
|
@ -59,18 +71,30 @@ const AutoCompleteProps = [
|
||||||
default: "false",
|
default: "false",
|
||||||
description: "Specifies if multiple values can be selected."
|
description: "Specifies if multiple values can be selected."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "placeholder",
|
||||||
|
type: "string",
|
||||||
|
default: "null",
|
||||||
|
description: "Default text to display when no option is selected."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "disabled",
|
||||||
|
type: "boolean",
|
||||||
|
default: "false",
|
||||||
|
description: "When present, it specifies that the component should be disabled."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dataKey",
|
||||||
|
type: "string",
|
||||||
|
default: "null",
|
||||||
|
description: "A property to uniquely identify an option."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "minLength",
|
name: "minLength",
|
||||||
type: "number",
|
type: "number",
|
||||||
default: "1",
|
default: "1",
|
||||||
description: "Minimum number of characters to initiate a search."
|
description: "Minimum number of characters to initiate a search."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "completeOnFocus",
|
|
||||||
type: "boolean",
|
|
||||||
default: "false",
|
|
||||||
description: "Whether to run a query when input receives focus."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "delay",
|
name: "delay",
|
||||||
type: "number",
|
type: "number",
|
||||||
|
@ -83,9 +107,27 @@ const AutoCompleteProps = [
|
||||||
default: "body",
|
default: "body",
|
||||||
description: '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.'
|
description: '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.'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "forceSelection",
|
||||||
|
type: "boolean",
|
||||||
|
default: "false",
|
||||||
|
description: "When present, autocomplete clears the manual input if it does not match of the suggestions to force only accepting values from the suggestions."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "completeOnFocus",
|
||||||
|
type: "boolean",
|
||||||
|
default: "false",
|
||||||
|
description: "Whether to run a query when input receives focus."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "inputId",
|
||||||
|
type: "string",
|
||||||
|
default: "null",
|
||||||
|
description: "Identifier of the underlying input element."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "inputStyle",
|
name: "inputStyle",
|
||||||
type: "any",
|
type: "object",
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Inline style of the input field."
|
description: "Inline style of the input field."
|
||||||
},
|
},
|
||||||
|
@ -96,22 +138,16 @@ const AutoCompleteProps = [
|
||||||
description: "Style class of the input field."
|
description: "Style class of the input field."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "forceSelection",
|
name: "inputProps",
|
||||||
type: "boolean",
|
type: "object",
|
||||||
default: "false",
|
default: "null",
|
||||||
description: "When present, autocomplete clears the manual input if it does not match of the suggestions to force only accepting values from the suggestions."
|
description: "Uses to pass all properties of the HTMLInputElement/HTMLSpanElement to the focusable input element inside the component."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "class",
|
name: "panelStyle",
|
||||||
type: "string",
|
type: "object",
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Style class of the component."
|
description: "Inline style of the overlay panel."
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "style",
|
|
||||||
type: "any",
|
|
||||||
default: "null",
|
|
||||||
description: "Inline of the component."
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "panelClass",
|
name: "panelClass",
|
||||||
|
@ -119,6 +155,12 @@ const AutoCompleteProps = [
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Style class of the overlay panel."
|
description: "Style class of the overlay panel."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "panelProps",
|
||||||
|
type: "object",
|
||||||
|
default: "null",
|
||||||
|
description: "Uses to pass all properties of the HTMLDivElement to the overlay panel inside the component."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "loadingIcon",
|
name: "loadingIcon",
|
||||||
type: "string",
|
type: "string",
|
||||||
|
@ -130,23 +172,99 @@ const AutoCompleteProps = [
|
||||||
type: "object",
|
type: "object",
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it."
|
description: "Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "autoOptionFocus",
|
||||||
|
type: "boolean",
|
||||||
|
default: "true",
|
||||||
|
description: "Whether to focus on the first visible or selected element when the overlay panel is shown."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "searchLocale",
|
||||||
|
type: "string",
|
||||||
|
default: "undefined",
|
||||||
|
description: "Locale to use in searching. The default locale is the host environment's current locale."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "searchMessage",
|
||||||
|
type: "string",
|
||||||
|
default: "{0} results are available",
|
||||||
|
description: "Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "selectionMessage",
|
||||||
|
type: "string",
|
||||||
|
default: "{0} items selected",
|
||||||
|
description: "Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "emptySelectionMessage",
|
||||||
|
type: "string",
|
||||||
|
default: "No selected item",
|
||||||
|
description: "Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "emptySearchMessage",
|
||||||
|
type: "string",
|
||||||
|
default: "No results found",
|
||||||
|
description: "Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "tabindex",
|
||||||
|
type: "number",
|
||||||
|
default: "0",
|
||||||
|
description: "Index of the element in tabbing order."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ariaLabel",
|
||||||
|
type: "string",
|
||||||
|
default: "null",
|
||||||
|
description: "Defines a string value that labels an interactive element."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ariaLabelledby",
|
||||||
|
type: "string",
|
||||||
|
default: "null",
|
||||||
|
description: "Identifier of the underlying input element."
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const AutoCompleteEvents = [
|
const AutoCompleteEvents = [
|
||||||
{
|
{
|
||||||
name: "complete",
|
name: "change",
|
||||||
description: "Callback to invoke to search for suggestions.",
|
description: "Callback to invoke on value change.",
|
||||||
arguments: [
|
arguments: [
|
||||||
{
|
{
|
||||||
name: "originalEvent",
|
name: "event.originalEvent",
|
||||||
type: "object",
|
type: "object",
|
||||||
description: "Original event"
|
description: "Browser event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "query",
|
name: "event.value",
|
||||||
type: "string",
|
type: "string",
|
||||||
description: "Value to search with"
|
description: "Selected option value"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "focus",
|
||||||
|
description: "Callback to invoke when component receives focus.",
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: "event",
|
||||||
|
type: "object",
|
||||||
|
description: "Browser event"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "blur",
|
||||||
|
description: "Callback to invoke when component loses focus.",
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: "event",
|
||||||
|
type: "object",
|
||||||
|
description: "Browser event"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -201,17 +319,45 @@ const AutoCompleteEvents = [
|
||||||
{
|
{
|
||||||
name: "clear",
|
name: "clear",
|
||||||
description: "Callback to invoke when input is cleared by the user."
|
description: "Callback to invoke when input is cleared by the user."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "complete",
|
||||||
|
description: "Callback to invoke to search for suggestions.",
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: "originalEvent",
|
||||||
|
type: "object",
|
||||||
|
description: "Original event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "query",
|
||||||
|
type: "string",
|
||||||
|
description: "Value to search with"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "before-show",
|
||||||
|
description: "Callback to invoke before the overlay is shown."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "before-hide",
|
||||||
|
description: "Callback to invoke before the overlay is hidden."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "show",
|
||||||
|
description: "Callback to invoke when the overlay is shown."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "hide",
|
||||||
|
description: "Callback to invoke when the overlay is hidden."
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const AutoCompleteSlots = [
|
const AutoCompleteSlots = [
|
||||||
{
|
{
|
||||||
name: "item",
|
name: "chip",
|
||||||
description: "Custom content for the item."
|
description: "Custom content for the chip display."
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "optiongroup",
|
|
||||||
description: "Custom content for the optiongroup item."
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "header",
|
name: "header",
|
||||||
|
@ -222,8 +368,16 @@ const AutoCompleteSlots = [
|
||||||
description: "Custom content for the component footer."
|
description: "Custom content for the component footer."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "chip",
|
name: "item",
|
||||||
description: "Custom content for the chip display."
|
description: "Custom content for the item."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "option",
|
||||||
|
description: "Custom content for the item."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "optiongroup",
|
||||||
|
description: "Custom content for the optiongroup item."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "content",
|
name: "content",
|
||||||
|
|
|
@ -4,10 +4,27 @@ import { VirtualScrollerProps, VirtualScrollerItemOptions } from '../virtualscro
|
||||||
|
|
||||||
type AutoCompleteFieldType = string | ((data: any) => string) | undefined;
|
type AutoCompleteFieldType = string | ((data: any) => string) | undefined;
|
||||||
|
|
||||||
|
type AutoCompleteOptionLabelType = string | ((data: any) => string) | undefined;
|
||||||
|
|
||||||
|
type AutoCompleteOptionDisabledType = string | ((data: any) => boolean) | undefined;
|
||||||
|
|
||||||
|
type AutoCompleteOptionChildrenType = string | ((data: any) => any[]) | undefined;
|
||||||
|
|
||||||
type AutoCompleteDropdownMode = 'blank' | 'current' | undefined;
|
type AutoCompleteDropdownMode = 'blank' | 'current' | undefined;
|
||||||
|
|
||||||
type AutoCompleteAppendTo = 'body' | 'self' | string | undefined | HTMLElement;
|
type AutoCompleteAppendTo = 'body' | 'self' | string | undefined | HTMLElement;
|
||||||
|
|
||||||
|
export interface AutoCompleteChangeEvent {
|
||||||
|
/**
|
||||||
|
* Browser event.
|
||||||
|
*/
|
||||||
|
originalEvent: Event;
|
||||||
|
/**
|
||||||
|
* Selected option value
|
||||||
|
*/
|
||||||
|
value: any;
|
||||||
|
}
|
||||||
|
|
||||||
export interface AutoCompleteItemSelectEvent {
|
export interface AutoCompleteItemSelectEvent {
|
||||||
/**
|
/**
|
||||||
* Browser event
|
* Browser event
|
||||||
|
@ -56,18 +73,31 @@ export interface AutoCompleteProps {
|
||||||
*/
|
*/
|
||||||
suggestions?: any[];
|
suggestions?: any[];
|
||||||
/**
|
/**
|
||||||
|
* @deprecated since v3.16.0. Use 'optionLabel' property instead.
|
||||||
* Property name or getter function of a suggested object to resolve and display.
|
* Property name or getter function of a suggested object to resolve and display.
|
||||||
* @type {AutoCompleteFieldType}
|
* @type {AutoCompleteFieldType}
|
||||||
*/
|
*/
|
||||||
field?: AutoCompleteFieldType;
|
field?: AutoCompleteFieldType;
|
||||||
/**
|
/**
|
||||||
* Property name or getter function to use as the label of an option group.
|
* Property name or getter function to use as the label of an option.
|
||||||
|
* @see AutoCompleteOptionLabelType
|
||||||
*/
|
*/
|
||||||
optionGroupLabel?: string | undefined;
|
optionLabel?: AutoCompleteOptionLabelType;
|
||||||
|
/**
|
||||||
|
* Property name or getter function to use as the disabled flag of an option, defaults to false when not defined.
|
||||||
|
* @see AutoCompleteOptionDisabledType
|
||||||
|
*/
|
||||||
|
optionDisabled?: AutoCompleteOptionDisabledType;
|
||||||
|
/**
|
||||||
|
* Property name or getter function to use as the label of an option group.
|
||||||
|
* @see AutoCompletenOptionLabelType
|
||||||
|
*/
|
||||||
|
optionGroupLabel?: AutoCompletenOptionLabelType;
|
||||||
/**
|
/**
|
||||||
* Property name or getter function that refers to the children options of option group.
|
* Property name or getter function that refers to the children options of option group.
|
||||||
|
* @see AutoCompleteOptionChildrenType
|
||||||
*/
|
*/
|
||||||
optionGroupChildren?: string | undefined;
|
optionGroupChildren?: AutoCompleteOptionChildrenType;
|
||||||
/**
|
/**
|
||||||
* Maximum height of the suggestions panel.
|
* Maximum height of the suggestions panel.
|
||||||
* Default value is '200px'.
|
* Default value is '200px'.
|
||||||
|
@ -84,6 +114,7 @@ export interface AutoCompleteProps {
|
||||||
*/
|
*/
|
||||||
dropdownMode?: AutoCompleteDropdownMode;
|
dropdownMode?: AutoCompleteDropdownMode;
|
||||||
/**
|
/**
|
||||||
|
* @deprecated since v3.16.0
|
||||||
* Highlights automatically the first item of the dropdown to be selected.
|
* Highlights automatically the first item of the dropdown to be selected.
|
||||||
*/
|
*/
|
||||||
autoHighlight?: boolean | undefined;
|
autoHighlight?: boolean | undefined;
|
||||||
|
@ -91,6 +122,18 @@ export interface AutoCompleteProps {
|
||||||
* Specifies if multiple values can be selected.
|
* Specifies if multiple values can be selected.
|
||||||
*/
|
*/
|
||||||
multiple?: boolean | undefined;
|
multiple?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Default text to display when no option is selected.
|
||||||
|
*/
|
||||||
|
placeholder?: string | undefined;
|
||||||
|
/**
|
||||||
|
* When present, it specifies that the component should be disabled.
|
||||||
|
*/
|
||||||
|
disabled?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* A property to uniquely identify an option.
|
||||||
|
*/
|
||||||
|
dataKey?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* Minimum number of characters to initiate a search.
|
* Minimum number of characters to initiate a search.
|
||||||
* Default value is 1.
|
* Default value is 1.
|
||||||
|
@ -116,6 +159,10 @@ export interface AutoCompleteProps {
|
||||||
* Whether to run a query when input receives focus.
|
* Whether to run a query when input receives focus.
|
||||||
*/
|
*/
|
||||||
completeOnFocus?: boolean | undefined;
|
completeOnFocus?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Identifier of the underlying input element.
|
||||||
|
*/
|
||||||
|
inputId?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* Inline style of the input field.
|
* Inline style of the input field.
|
||||||
*/
|
*/
|
||||||
|
@ -123,19 +170,23 @@ export interface AutoCompleteProps {
|
||||||
/**
|
/**
|
||||||
* Style class of the input field.
|
* Style class of the input field.
|
||||||
*/
|
*/
|
||||||
inputClass?: string;
|
inputClass?: any;
|
||||||
/**
|
/**
|
||||||
* Inline style of the component.
|
* Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
||||||
*/
|
*/
|
||||||
class?: any;
|
inputProps?: HTMLInputElement | undefined;
|
||||||
/**
|
/**
|
||||||
* Style class of the component input field.
|
* Inline style of the overlay panel.
|
||||||
*/
|
*/
|
||||||
style?: any;
|
panelStyle?: any;
|
||||||
/**
|
/**
|
||||||
* Style class of the overlay panel.
|
* Style class of the overlay panel.
|
||||||
*/
|
*/
|
||||||
panelClass?: any;
|
panelClass?: any;
|
||||||
|
/**
|
||||||
|
* Uses to pass all properties of the HTMLDivElement to the overlay panel inside the component.
|
||||||
|
*/
|
||||||
|
panelProps?: HTMLDivElement | undefined;
|
||||||
/**
|
/**
|
||||||
* Icon to display in loading state.
|
* Icon to display in loading state.
|
||||||
* Default value is 'pi pi-spinner pi-spin'.
|
* Default value is 'pi pi-spinner pi-spin'.
|
||||||
|
@ -146,36 +197,59 @@ export interface AutoCompleteProps {
|
||||||
* @see VirtualScroller.VirtualScrollerProps
|
* @see VirtualScroller.VirtualScrollerProps
|
||||||
*/
|
*/
|
||||||
virtualScrollerOptions?: VirtualScrollerProps;
|
virtualScrollerOptions?: VirtualScrollerProps;
|
||||||
|
/**
|
||||||
|
* Whether to focus on the first visible or selected element when the overlay panel is shown.
|
||||||
|
* Default value is true.
|
||||||
|
*/
|
||||||
|
autoOptionFocus?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Locale to use in searching. The default locale is the host environment's current locale.
|
||||||
|
*/
|
||||||
|
searchLocale?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration.
|
||||||
|
* Default value is '{0} results are available'.
|
||||||
|
*/
|
||||||
|
searchMessage?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration.
|
||||||
|
* Default value is '{0} items selected'.
|
||||||
|
*/
|
||||||
|
selectionMessage?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration.
|
||||||
|
* Default value is 'No selected item'.
|
||||||
|
*/
|
||||||
|
emptySelectionMessage?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration.
|
||||||
|
* Default value is 'No results found'.
|
||||||
|
*/
|
||||||
|
emptySearchMessage?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Index of the element in tabbing order.
|
||||||
|
*/
|
||||||
|
tabindex?: number | string | undefined;
|
||||||
|
/**
|
||||||
|
* Defines a string value that labels an interactive element.
|
||||||
|
*/
|
||||||
|
ariaLabel?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Identifier of the underlying input element.
|
||||||
|
*/
|
||||||
|
ariaLabelledby?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutoCompleteSlots {
|
export interface AutoCompleteSlots {
|
||||||
/**
|
/**
|
||||||
* Custom content for each item.
|
* Custom chip template.
|
||||||
* @param {Object} scope - item slot's params.
|
* @param {Object} scope - chip slot's params.
|
||||||
*/
|
*/
|
||||||
item: (scope: {
|
chip: (scope: {
|
||||||
/**
|
/**
|
||||||
* Option instance
|
* A value in the selection
|
||||||
*/
|
*/
|
||||||
item: any;
|
value: any;
|
||||||
/**
|
|
||||||
* Index of the option
|
|
||||||
*/
|
|
||||||
index: number;
|
|
||||||
}) => VNode[];
|
|
||||||
/**
|
|
||||||
* Custom option group template.
|
|
||||||
* @param {Object} scope - option group slot's params.
|
|
||||||
*/
|
|
||||||
optiongroup: (scope: {
|
|
||||||
/**
|
|
||||||
* Option instance
|
|
||||||
*/
|
|
||||||
item: any;
|
|
||||||
/**
|
|
||||||
* Index of the option
|
|
||||||
*/
|
|
||||||
index: number;
|
|
||||||
}) => VNode[];
|
}) => VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom header template of panel.
|
* Custom header template of panel.
|
||||||
|
@ -206,14 +280,52 @@ export interface AutoCompleteSlots {
|
||||||
suggestions: any[];
|
suggestions: any[];
|
||||||
}) => VNode[];
|
}) => VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom chip template.
|
* @deprecated since v3.16.0
|
||||||
* @param {Object} scope - chip slot's params.
|
* Custom content for each item.
|
||||||
|
* @param {Object} scope - item slot's params.
|
||||||
*/
|
*/
|
||||||
chip: (scope: {
|
item: (scope: {
|
||||||
/**
|
/**
|
||||||
* A value in the selection
|
* Option instance
|
||||||
*/
|
*/
|
||||||
value: any;
|
item: any;
|
||||||
|
/**
|
||||||
|
* Index of the option
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
}) => VNode[];
|
||||||
|
/**
|
||||||
|
* Custom option template.
|
||||||
|
* @param {Object} scope - option slot's params.
|
||||||
|
*/
|
||||||
|
option: (scope: {
|
||||||
|
/**
|
||||||
|
* Option instance
|
||||||
|
*/
|
||||||
|
option: any;
|
||||||
|
/**
|
||||||
|
* Index of the option
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
}) => VNode[];
|
||||||
|
/**
|
||||||
|
* Custom option group template.
|
||||||
|
* @param {Object} scope - option group slot's params.
|
||||||
|
*/
|
||||||
|
optiongroup: (scope: {
|
||||||
|
/**
|
||||||
|
* @deprecated since v3.16.0. Use the 'option' instead.
|
||||||
|
* Option instance
|
||||||
|
*/
|
||||||
|
item: any;
|
||||||
|
/**
|
||||||
|
* Option instance
|
||||||
|
*/
|
||||||
|
option: any;
|
||||||
|
/**
|
||||||
|
* Index of the option
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
}) => VNode[];
|
}) => VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom panel template.
|
* Custom panel template.
|
||||||
|
@ -258,6 +370,21 @@ export declare type AutoCompleteEmits = {
|
||||||
* @param {*} value - New value.
|
* @param {*} value - New value.
|
||||||
*/
|
*/
|
||||||
'update:modelValue': (value: any) => void;
|
'update:modelValue': (value: any) => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke on value change.
|
||||||
|
* @param {AutoCompleteChangeEvent} event - Custom change event.
|
||||||
|
*/
|
||||||
|
'change': (event: AutoCompleteChangeEvent) => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when the component receives focus.
|
||||||
|
* @param {Event} event - Browser event.
|
||||||
|
*/
|
||||||
|
'focus': (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when the component loses focus.
|
||||||
|
* @param {Event} event - Browser event.
|
||||||
|
*/
|
||||||
|
'blur': (event: Event) => void;
|
||||||
/**
|
/**
|
||||||
* Callback to invoke when a suggestion is selected.
|
* Callback to invoke when a suggestion is selected.
|
||||||
* @param {AutoCompleteItemSelectEvent} event - Custom item select event.
|
* @param {AutoCompleteItemSelectEvent} event - Custom item select event.
|
||||||
|
@ -273,15 +400,31 @@ export declare type AutoCompleteEmits = {
|
||||||
* @param {AutoCompleteDropdownClickEvent} event - Custom dropdown click event.
|
* @param {AutoCompleteDropdownClickEvent} event - Custom dropdown click event.
|
||||||
*/
|
*/
|
||||||
'dropdown-click': (event: AutoCompleteDropdownClickEvent) => void;
|
'dropdown-click': (event: AutoCompleteDropdownClickEvent) => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when input is cleared by the user.
|
||||||
|
*/
|
||||||
|
'clear': () => void;
|
||||||
/**
|
/**
|
||||||
* Callback to invoke to search for suggestions.
|
* Callback to invoke to search for suggestions.
|
||||||
* @param {AutoCompleteCompleteEvent} event - Custom complete event.
|
* @param {AutoCompleteCompleteEvent} event - Custom complete event.
|
||||||
*/
|
*/
|
||||||
'complete': (event: AutoCompleteCompleteEvent) => void;
|
'complete': (event: AutoCompleteCompleteEvent) => void;
|
||||||
/**
|
/**
|
||||||
* Callback to invoke when input is cleared by the user.
|
* Callback to invoke before the overlay is shown.
|
||||||
*/
|
*/
|
||||||
'clear': () => void;
|
'before-show': () => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke before the overlay is hidden.
|
||||||
|
*/
|
||||||
|
'before-hide': () => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when the overlay is shown.
|
||||||
|
*/
|
||||||
|
'show': () => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when the overlay is hidden.
|
||||||
|
*/
|
||||||
|
'hide': () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class AutoComplete extends ClassComponent<AutoCompleteProps, AutoCompleteSlots, AutoCompleteEmits> { }
|
declare class AutoComplete extends ClassComponent<AutoCompleteProps, AutoCompleteSlots, AutoCompleteEmits> { }
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue