primevue-mirror/components/lib/listbox/style/ListboxStyle.js

34 lines
1003 B
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const classes = {
2024-03-18 10:02:20 +00:00
root: ({ props }) => [
'p-listbox p-component',
{
2024-03-22 08:57:54 +00:00
'p-listbox-striped': props.stripedRows,
'p-disabled': props.disabled,
'p-invalid': props.invalid
}
],
header: 'p-listbox-header',
filterContainer: 'p-listbox-filter-container',
2024-03-18 10:02:20 +00:00
filterInput: 'p-listbox-filter',
filterIcon: 'p-listbox-filter-icon',
wrapper: 'p-listbox-list-wrapper',
list: 'p-listbox-list',
itemGroup: 'p-listbox-item-group',
item: ({ instance, option, index, getItemOptions }) => [
'p-listbox-item',
{
'p-highlight': instance.isSelected(option),
'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
'p-disabled': instance.isOptionDisabled(option)
}
],
emptyMessage: 'p-listbox-empty-message'
};
export default BaseStyle.extend({
name: 'listbox',
classes
});