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-treeselect p-component p-inputwrapper',
|
|
|
|
{
|
2024-04-07 11:02:54 +00:00
|
|
|
'p-treeselect-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,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-focus': instance.focused,
|
2024-02-02 13:26:27 +00:00
|
|
|
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled',
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-inputwrapper-filled': !instance.emptyValue,
|
2024-04-07 11:02:54 +00:00
|
|
|
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
|
|
|
|
'p-treeselect-open': instance.overlayVisible
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
labelContainer: 'p-treeselect-label-container',
|
|
|
|
label: ({ instance, props }) => [
|
|
|
|
'p-treeselect-label',
|
|
|
|
{
|
|
|
|
'p-placeholder': instance.label === props.placeholder,
|
|
|
|
'p-treeselect-label-empty': !props.placeholder && instance.emptyValue
|
|
|
|
}
|
|
|
|
],
|
2024-04-07 11:02:54 +00:00
|
|
|
token: 'p-treeselect-chip',
|
|
|
|
tokenLabel: 'p-treeselect-chip-label',
|
|
|
|
trigger: 'p-treeselect-dropdown',
|
|
|
|
triggerIcon: 'p-treeselect-dropdown-icon',
|
2024-03-22 08:58:03 +00:00
|
|
|
panel: ({ instance }) => [
|
2024-04-07 11:02:54 +00:00
|
|
|
'p-treeselect-overlay p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
|
|
|
}
|
|
|
|
],
|
2024-04-07 11:02:54 +00:00
|
|
|
wrapper: 'p-treeselect-tree-container',
|
2023-10-02 10:46:09 +00:00
|
|
|
emptyMessage: 'p-treeselect-empty-message'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'treeselect',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|