primevue-mirror/components/lib/badge/style/BadgeStyle.js

26 lines
927 B
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
import { ObjectUtils } from 'primevue/utils';
const classes = {
root: ({ props, instance }) => [
'p-badge p-component',
{
2024-04-08 10:55:04 +00:00
'p-badge-circle': ObjectUtils.isNotEmpty(props.value) && String(props.value).length === 1,
'p-badge-dot': ObjectUtils.isEmpty(props.value) && !instance.$slots.default,
'p-badge-lg': props.size === 'large',
'p-badge-xl': props.size === 'xlarge',
'p-badge-info': props.severity === 'info',
'p-badge-success': props.severity === 'success',
2024-04-07 21:44:30 +00:00
'p-badge-warn': props.severity === 'warn',
'p-badge-danger': props.severity === 'danger',
'p-badge-secondary': props.severity === 'secondary',
'p-badge-contrast': props.severity === 'contrast'
}
]
};
export default BaseStyle.extend({
name: 'badge',
classes
});