2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const inlineStyles = {
|
|
|
|
root: ({ props }) => ({ position: props.appendTo === 'self' ? 'relative' : undefined })
|
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-multiselect p-component p-inputwrapper',
|
|
|
|
{
|
2024-04-07 10:35:07 +00:00
|
|
|
'p-multiselect-display-chip': props.display === 'chip',
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-disabled': props.disabled,
|
2024-01-30 11:27:56 +00:00
|
|
|
'p-invalid': props.invalid,
|
2024-02-02 11:46:26 +00:00
|
|
|
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled',
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-focus': instance.focused,
|
|
|
|
'p-inputwrapper-filled': props.modelValue && props.modelValue.length,
|
|
|
|
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
|
2024-04-07 10:35:07 +00:00
|
|
|
'p-multiselect-open': instance.overlayVisible
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
labelContainer: 'p-multiselect-label-container',
|
|
|
|
label: ({ instance, props }) => [
|
|
|
|
'p-multiselect-label',
|
|
|
|
{
|
|
|
|
'p-placeholder': instance.label === props.placeholder,
|
|
|
|
'p-multiselect-label-empty': !props.placeholder && (!props.modelValue || props.modelValue.length === 0)
|
|
|
|
}
|
|
|
|
],
|
2024-04-07 10:35:07 +00:00
|
|
|
token: 'p-multiselect-chip',
|
|
|
|
tokenLabel: 'p-multiselect-chip-label',
|
|
|
|
removeTokenIcon: 'p-multiselect-chip-icon',
|
|
|
|
trigger: 'p-multiselect-dropdown',
|
|
|
|
loadingIcon: 'p-multiselect-loading-icon',
|
|
|
|
dropdownIcon: 'p-multiselect-dropdown-icon',
|
2024-03-18 10:02:32 +00:00
|
|
|
panel: ({ instance }) => [
|
2024-04-07 10:35:07 +00:00
|
|
|
'p-multiselect-overlay p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
header: 'p-multiselect-header',
|
|
|
|
filterContainer: 'p-multiselect-filter-container',
|
2024-03-18 10:02:32 +00:00
|
|
|
filterInput: 'p-multiselect-filter',
|
2023-10-02 10:46:09 +00:00
|
|
|
filterIcon: 'p-multiselect-filter-icon',
|
2024-04-07 10:35:07 +00:00
|
|
|
wrapper: 'p-multiselect-list-container',
|
|
|
|
list: 'p-multiselect-list',
|
|
|
|
itemGroup: 'p-multiselect-option-group',
|
2024-01-18 13:05:30 +00:00
|
|
|
item: ({ instance, option, index, getItemOptions, props }) => [
|
2024-04-07 10:35:07 +00:00
|
|
|
'p-multiselect-option',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-07 10:35:07 +00:00
|
|
|
'p-multiselect-option-selected': instance.isSelected(option) && props.highlightOnSelect,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
|
|
|
|
'p-disabled': instance.isOptionDisabled(option)
|
|
|
|
}
|
|
|
|
],
|
|
|
|
emptyMessage: 'p-multiselect-empty-message'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'multiselect',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|