primevue-mirror/api-generator/components/listbox.js

302 lines
9.0 KiB
JavaScript
Raw Permalink Normal View History

const ListboxProps = [
{
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: 'options',
type: 'array',
default: 'null',
description: 'An array of selectitems to display as the available options.'
},
{
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: 'optionValue',
type: 'string | function',
default: 'null',
description: 'Property name or getter function to use as the value of an option, defaults to the option itself when not defined.'
},
{
2022-09-14 14:26:41 +00:00
name: 'optionDisabled',
type: 'boolean | function',
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 | function',
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 | function',
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: 'listStyle',
type: 'string',
default: 'null',
description: 'Inline style of inner list element.'
},
{
2022-09-14 14:26:41 +00:00
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'When specified, disables the component.'
},
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.'
},
{
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: 'multiple',
type: 'boolean',
default: 'false',
description: 'When specified, allows selecting multiple values.'
},
{
2022-09-14 14:26:41 +00:00
name: 'metaKeySelection',
type: 'boolean',
default: 'true',
description:
'Defines how multiple items can be selected, when true metaKey needs to be pressed to select or unselect an item and when set to false selection of each item can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically.'
},
{
2022-09-14 14:26:41 +00:00
name: 'filter',
type: 'boolean',
default: 'false',
description: 'When specified, displays a filter input at header.'
},
{
2022-09-14 14:26:41 +00:00
name: 'filterPlaceholder',
type: 'string',
default: 'null',
description: 'Placeholder text to show when filter input is empty.'
},
{
2022-09-14 14:26:41 +00:00
name: 'filterLocale',
type: 'string',
default: 'undefined',
description: "Locale to use in filtering. The default locale is the host environment's current locale."
},
{
2022-09-14 14:26:41 +00:00
name: 'filterMatchMode',
type: 'string',
default: 'contains',
description: 'Defines the filtering algorithm to use when searching the options. Valid values are "contains" (default), "startsWith" and "endsWith"'
},
{
2022-09-14 14:26:41 +00:00
name: 'filterFields',
type: 'array',
default: 'null',
description: 'Fields used when filtering the options, defaults to optionLabel.'
},
{
2022-09-14 14:26:41 +00:00
name: 'filterInputProps',
type: 'object',
default: 'null',
2023-08-01 14:01:12 +00:00
description: 'Used to pass all properties of the HTMLInputElement to the filter input inside the component.'
},
{
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.'
},
{
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: 'filterMessage',
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: 'emptyFilterMessage',
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: 'emptyMessage',
type: 'string',
default: 'No results found',
description: 'Text to display when there are no options available. 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-07 21:07:47 +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 ListboxEvents = [
{
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: 'object',
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: 'filter',
description: 'Callback to invoke on filter input.',
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: 'Filter value'
}
]
}
];
const ListboxSlots = [
{
2022-09-14 14:26:41 +00:00
name: 'option',
description: "Custom content for the item's option."
},
{
2022-09-14 14:26:41 +00:00
name: 'optiongroup',
description: "Custom content for the item's optiongroup."
},
{
2022-09-14 14:26:41 +00:00
name: 'header',
description: "Custom content for the component's header."
},
{
2022-09-14 14:26:41 +00:00
name: 'footer',
description: "Custom content for the component's footer."
},
{
2022-09-14 14:26:41 +00:00
name: 'emptyfilter',
description: 'Custom content when there is no filtered data to display.'
},
{
2022-09-14 14:26:41 +00:00
name: 'empty',
description: 'Custom content when there is no data to display.'
},
{
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: 'filtericon',
description: 'Custom filter icon template.'
}
];
module.exports = {
listbox: {
2022-09-14 14:26:41 +00:00
name: 'Listbox',
description: 'Listbox is used to select one or more values from a list of items.',
props: ListboxProps,
events: ListboxEvents,
slots: ListboxSlots
}
};