primevue-mirror/components/lib/chips/style/ChipsStyle.js

30 lines
1021 B
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const classes = {
root: ({ instance, props }) => [
2024-04-07 08:12:56 +00:00
'p-inputchips p-component p-inputwrapper',
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'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-08 10:49:53 +00:00
'p-inputchips-input',
2024-02-02 11:46:26 +00:00
{
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
}
],
2024-04-07 08:12:56 +00:00
token: ({ state, index }) => ['p-inputchips-chip', { 'p-focus': state.focusedIndex === index }],
label: 'p-inputchips-chip-label',
removeTokenIcon: 'p-inputchips-chip-icon',
inputToken: 'p-inputchips-input-item'
};
export default BaseStyle.extend({
name: 'chips',
classes
});