primevue-mirror/apps/showcase/api-generator/components/autocomplete.js

471 lines
13 KiB
JavaScript
Raw Normal View History

const AutoCompleteProps = [
{
2022-09-14 14:26:41 +00:00
name: 'modelValue',
type: 'any',
default: 'null',
description: 'Value of the component.'
},
{
2022-09-14 14:26:41 +00:00
name: 'suggestions',
type: 'array',
default: 'null',
description: 'An array of suggestions to display.'
},
{
2022-09-14 14:26:41 +00:00
name: 'field',
type: 'any',
default: 'null',
description: 'Property name or getter function of a suggested object to resolve and display.'
},
{
2022-09-14 14:26:41 +00:00
name: 'optionLabel',
type: 'string | function',
default: 'null',
description: 'Property name or getter function to use as the label of an option.'
},
{
2022-09-14 14:26:41 +00:00
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.'
},
{
2022-09-14 14:26:41 +00:00
name: 'optionGroupLabel',
type: 'string',
default: 'null',
description: 'Property name or getter function to use as the label of an option group.'
},
{
2022-09-14 14:26:41 +00:00
name: 'optionGroupChildren',
type: 'string',
default: 'null',
description: 'Property name or getter function that refers to the children options of option group.'
},
{
2022-09-14 14:26:41 +00:00
name: 'scrollHeight',
type: 'string',
default: '200px',
description: 'Maximum height of the suggestions panel.'
},
{
2022-09-14 14:26:41 +00:00
name: 'dropdown',
type: 'boolean',
default: 'false',
description: 'Displays a button next to the input field when enabled.'
},
{
2022-09-14 14:26:41 +00:00
name: 'dropdownMode',
type: 'string',
default: 'blank',
description: 'Specifies the behavior dropdown button. Default "blank" mode sends an empty string and "current" mode sends the input value.'
},
{
2022-09-14 14:26:41 +00:00
name: 'autoHighlight',
type: 'boolean',
default: false,
2022-09-14 14:26:41 +00:00
description: 'Highlights automatically the first item of the dropdown to be selected.'
},
{
2022-09-14 14:26:41 +00:00
name: 'multiple',
type: 'boolean',
default: 'false',
description: 'Specifies if multiple values can be selected.'
},
{
2022-09-14 14:26:41 +00:00
name: 'placeholder',
type: 'string',
default: 'null',
description: 'Default text to display when no option is selected.'
},
{
name: 'loading',
type: 'boolean',
default: 'false',
description: 'Whether the multiselect is in loading state.'
},
{
2022-09-14 14:26:41 +00:00
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'When present, it specifies that the component should be disabled.'
},
2024-01-31 08:01:02 +00:00
{
name: 'invalid',
type: 'boolean',
default: 'false',
description: 'When present, it specifies that the component should have invalid state style.'
},
{
name: 'variant',
type: 'string',
2024-02-02 13:26:27 +00:00
default: 'null',
2024-01-31 08:01:02 +00:00
description: 'Specifies the input variant of the component.'
},
{
2022-09-14 14:26:41 +00:00
name: 'dataKey',
type: 'string',
default: 'null',
description: 'A property to uniquely identify an option.'
},
{
2022-09-14 14:26:41 +00:00
name: 'minLength',
type: 'number',
default: '1',
description: 'Minimum number of characters to initiate a search.'
},
{
2022-09-14 14:26:41 +00:00
name: 'delay',
type: 'number',
default: '300',
description: 'Delay between keystrokes to wait before sending a query.'
},
{
2022-09-14 14:26:41 +00:00
name: 'appendTo',
type: 'string',
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.'
},
{
2022-09-14 14:26:41 +00:00
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.'
},
{
2022-09-14 14:26:41 +00:00
name: 'completeOnFocus',
type: 'boolean',
default: 'false',
description: 'Whether to run a query when input receives focus.'
},
{
2022-09-14 14:26:41 +00:00
name: 'inputId',
type: 'string',
default: 'null',
description: 'Identifier of the underlying input element.'
},
{
2022-09-14 14:26:41 +00:00
name: 'inputStyle',
type: 'object',
default: 'null',
description: 'Inline style of the input field.'
},
{
2022-09-14 14:26:41 +00:00
name: 'inputClass',
type: 'string | object',
2022-09-14 14:26:41 +00:00
default: 'null',
description: 'Style class of the input field.'
},
{
2022-09-14 14:26:41 +00:00
name: 'inputProps',
type: 'object',
default: 'null',
2023-08-01 14:01:12 +00:00
description: 'Used to pass all properties of the HTMLInputElement/HTMLSpanElement to the focusable input element inside the component.'
},
{
2022-09-14 14:26:41 +00:00
name: 'panelStyle',
type: 'object',
default: 'null',
description: 'Inline style of the overlay panel.'
},
{
2022-09-14 14:26:41 +00:00
name: 'panelClass',
type: 'string | object',
2022-09-14 14:26:41 +00:00
default: 'null',
description: 'Style class of the overlay panel.'
},
{
2022-09-14 14:26:41 +00:00
name: 'panelProps',
type: 'object',
default: 'null',
2023-08-01 14:01:12 +00:00
description: 'Used to pass all properties of the HTMLDivElement to the overlay panel inside the component.'
},
{
name: 'dropdownIcon',
type: 'string',
default: 'null',
description: 'Icon to display in the dropdown.'
},
{
name: 'dropdownClass',
type: 'string',
default: 'null',
description: 'Style class of the dropdown button.'
},
{
2022-09-14 14:26:41 +00:00
name: 'loadingIcon',
type: 'string',
default: 'null',
2022-09-14 14:26:41 +00:00
description: 'Icon to display in loading state.'
},
{
name: 'removeTokenIcon',
type: 'string',
default: 'null',
description: 'Icon to display in chip remove action.'
},
{
2022-09-14 14:26:41 +00:00
name: 'virtualScrollerOptions',
type: 'object',
default: 'null',
description: 'Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.'
},
{
2022-09-14 14:26:41 +00:00
name: 'autoOptionFocus',
type: 'boolean',
default: 'false',
2022-09-14 14:26:41 +00:00
description: 'Whether to focus on the first visible or selected element when the overlay panel is shown.'
},
{
2022-09-14 14:26:41 +00:00
name: 'selectOnFocus',
type: 'boolean',
default: 'false',
description: 'When enabled, the focused option is selected.'
},
{
2022-09-14 14:26:41 +00:00
name: 'searchLocale',
type: 'string',
default: 'undefined',
description: "Locale to use in searching. The default locale is the host environment's current locale."
},
{
2022-09-14 14:26:41 +00:00
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.'
},
{
2022-09-14 14:26:41 +00:00
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.'
},
{
2022-09-14 14:26:41 +00:00
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.'
},
{
2022-09-14 14:26:41 +00:00
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.'
},
{
2022-09-14 14:26:41 +00:00
name: 'tabindex',
type: 'number',
default: '0',
description: 'Index of the element in tabbing order.'
},
{
2022-09-14 14:26:41 +00:00
name: 'aria-label',
type: 'string',
default: 'null',
description: 'Defines a string value that labels an interactive element.'
},
{
2022-09-14 14:26:41 +00:00
name: 'aria-labelledby',
type: 'string',
default: 'null',
description: 'Identifier of the underlying input element.'
2023-05-05 06:40:09 +00:00
},
{
name: 'pt',
type: 'any',
default: 'null',
2023-08-01 14:01:12 +00:00
description: 'Used to pass attributes to DOM elements inside the component.'
2023-07-06 13:20:37 +00:00
},
{
name: 'unstyled',
type: 'boolean',
default: 'false',
description: 'When enabled, it removes component related styles in the core.'
}
];
const AutoCompleteEvents = [
{
2022-09-14 14:26:41 +00:00
name: 'change',
description: 'Callback to invoke on value change.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'event.originalEvent',
type: 'object',
description: 'Browser event'
},
{
2022-09-14 14:26:41 +00:00
name: 'event.value',
type: 'string',
description: 'Selected option value'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'focus',
description: 'Callback to invoke when component receives focus.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'event',
type: 'object',
description: 'Browser event'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'blur',
description: 'Callback to invoke when component loses focus.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'event',
type: 'object',
description: 'Browser event'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'item-select',
description: 'Callback to invoke when a suggestion is selected.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'originalEvent',
type: 'object',
description: 'Original event'
},
{
2022-09-14 14:26:41 +00:00
name: 'value',
type: 'object',
description: 'Selected item'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'item-unselect',
description: 'Callback to invoke when a selected value is removed.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'originalEvent',
type: 'object',
description: 'Original event'
},
{
2022-09-14 14:26:41 +00:00
name: 'value',
type: 'object',
description: 'Unselected item'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'dropdown-click',
description: 'Callback to invoke to when dropdown button is clicked.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'originalEvent',
type: 'object',
description: 'Original event'
},
{
2022-09-14 14:26:41 +00:00
name: 'query',
type: 'string',
description: 'Current value of the input field'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'clear',
description: 'Callback to invoke when input is cleared by the user.'
},
{
2022-09-14 14:26:41 +00:00
name: 'complete',
description: 'Callback to invoke to search for suggestions.',
arguments: [
{
2022-09-14 14:26:41 +00:00
name: 'originalEvent',
type: 'object',
description: 'Original event'
},
{
2022-09-14 14:26:41 +00:00
name: 'query',
type: 'string',
description: 'Value to search with'
}
]
},
{
2022-09-14 14:26:41 +00:00
name: 'before-show',
description: 'Callback to invoke before the overlay is shown.'
},
{
2022-09-14 14:26:41 +00:00
name: 'before-hide',
description: 'Callback to invoke before the overlay is hidden.'
},
{
2022-09-14 14:26:41 +00:00
name: 'show',
description: 'Callback to invoke when the overlay is shown.'
},
{
2022-09-14 14:26:41 +00:00
name: 'hide',
description: 'Callback to invoke when the overlay is hidden.'
}
];
const AutoCompleteSlots = [
{
2022-09-14 14:26:41 +00:00
name: 'chip',
description: 'Custom content for the chip display.'
},
{
2022-09-14 14:26:41 +00:00
name: 'header',
description: 'Custom content for the component header.'
},
{
2022-09-14 14:26:41 +00:00
name: 'footer',
description: 'Custom content for the component footer.'
},
{
2022-09-14 14:26:41 +00:00
name: 'item',
description: 'Custom content for the item.'
},
{
2022-09-14 14:26:41 +00:00
name: 'option',
description: 'Custom content for the item.'
},
{
2022-09-14 14:26:41 +00:00
name: 'optiongroup',
description: 'Custom content for the optiongroup item.'
},
{
2022-09-14 14:26:41 +00:00
name: 'content',
description: 'Custom content for the virtual scroller.'
},
{
2022-09-14 14:26:41 +00:00
name: 'loader',
description: 'Custom content for the virtual scroller loader items.'
},
{
name: 'empty',
description: 'Custom empty template when there is no data to display.'
},
{
name: 'dropdownicon',
description: 'Custom dropdown icon template.'
},
{
name: 'removetokenicon',
description: 'Custom remove token icon template.'
},
{
name: 'loadingicon',
description: 'Custom loading icon template.'
}
];
module.exports = {
autocomplete: {
2022-09-14 14:26:41 +00:00
name: 'AutoComplete',
description: 'AutoComplete is an input component that provides real-time suggestions when being typed.',
props: AutoCompleteProps,
events: AutoCompleteEvents,
slots: AutoCompleteSlots
}
};