2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-chips p-component p-inputwrapper',
|
|
|
|
{
|
|
|
|
'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,
|
|
|
|
'p-inputwrapper-filled': (props.modelValue && props.modelValue.length) || (instance.inputValue && instance.inputValue.length),
|
|
|
|
'p-inputwrapper-focus': instance.focused
|
|
|
|
}
|
|
|
|
],
|
2024-02-02 11:46:26 +00:00
|
|
|
container: ({ props, instance }) => [
|
2024-04-06 20:24:27 +00:00
|
|
|
'p-chips-list',
|
2024-02-02 11:46:26 +00:00
|
|
|
{
|
|
|
|
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
|
|
|
|
}
|
|
|
|
],
|
2024-04-06 20:24:27 +00:00
|
|
|
token: ({ state, index }) => ['p-chips-item', { 'p-focus': state.focusedIndex === index }],
|
|
|
|
label: 'p-chips-item-label',
|
|
|
|
removeTokenIcon: 'p-chips-item-icon',
|
|
|
|
inputToken: 'p-chips-input-item'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'chips',
|
|
|
|
classes
|
|
|
|
});
|