Fixed #5176 - variant added

This commit is contained in:
tugcekucukoglu 2024-01-31 11:02:53 +03:00
parent d43ea02957
commit ff22cfe15e
45 changed files with 182 additions and 22 deletions

View file

@ -16,6 +16,10 @@ export default {
type: String,
default: null
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false

View file

@ -189,6 +189,11 @@ export interface TreeSelectProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Index of the element in tabbing order.
*/

View file

@ -66,6 +66,7 @@ const classes = {
'p-treeselect-chip': props.display === 'chip',
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-focus': instance.focused,
'p-inputwrapper-filled': !instance.emptyValue,
'p-inputwrapper-focus': instance.focused || instance.overlayVisible
@ -83,10 +84,10 @@ const classes = {
tokenLabel: 'p-treeselect-token-label',
trigger: 'p-treeselect-trigger',
triggerIcon: 'p-treeselect-trigger-icon',
panel: ({ instance }) => [
panel: ({ props, instance }) => [
'p-treeselect-panel p-component',
{
'p-input-filled': instance.$primevue.config.inputStyle === 'filled',
'p-input-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled',
'p-ripple-disabled': instance.$primevue.config.ripple === false
}
],