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-cascadeselect p-component p-inputwrapper',
|
|
|
|
{
|
|
|
|
'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,
|
|
|
|
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
|
2024-04-06 23:14:45 +00:00
|
|
|
'p-cascadeselect-open': instance.overlayVisible
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
label: ({ instance, props }) => [
|
2024-03-22 08:53:44 +00:00
|
|
|
'p-cascadeselect-label',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-placeholder': instance.label === props.placeholder,
|
|
|
|
'p-cascadeselect-label-empty': !instance.$slots['value'] && (instance.label === 'p-emptylabel' || instance.label.length === 0)
|
|
|
|
}
|
|
|
|
],
|
2024-04-06 23:14:45 +00:00
|
|
|
dropdownButton: 'p-cascadeselect-dropdown',
|
|
|
|
loadingIcon: 'p-cascadeselect-loading-icon',
|
|
|
|
dropdownIcon: 'p-cascadeselect-dropdown-icon',
|
|
|
|
panel: ({ instance }) => [
|
|
|
|
'p-cascadeselect-overlay p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
|
|
|
}
|
|
|
|
],
|
2024-04-06 23:14:45 +00:00
|
|
|
wrapper: 'p-cascadeselect-list-container',
|
|
|
|
rootList: 'p-cascadeselect-list',
|
2023-10-02 10:46:09 +00:00
|
|
|
item: ({ instance, processedOption }) => [
|
|
|
|
'p-cascadeselect-item',
|
|
|
|
{
|
2024-03-25 15:19:22 +00:00
|
|
|
'p-cascadeselect-item-active': instance.isOptionActive(processedOption),
|
2024-04-06 23:14:45 +00:00
|
|
|
'p-cascadeselect-item-selected': instance.isOptionSelected(processedOption),
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-focus': instance.isOptionFocused(processedOption),
|
|
|
|
'p-disabled': instance.isOptionDisabled(processedOption)
|
|
|
|
}
|
|
|
|
],
|
|
|
|
content: 'p-cascadeselect-item-content',
|
|
|
|
text: 'p-cascadeselect-item-text',
|
|
|
|
groupIcon: 'p-cascadeselect-group-icon',
|
2024-04-06 23:14:45 +00:00
|
|
|
sublist: 'p-cascadeselect-overlay p-cascadeselect-item-list'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'cascadeselect',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|