primevue-mirror/components/lib/rating/style/RatingStyle.js

33 lines
866 B
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const classes = {
root: ({ props }) => [
'p-rating',
{
'p-readonly': props.readonly,
'p-disabled': props.disabled
}
],
cancelItem: ({ instance }) => [
'p-rating-item p-rating-cancel-item',
{
2024-03-26 07:28:22 +00:00
'p-focus-visible': instance.focusedOptionIndex === 0 && instance.isFocusVisibleItem
}
],
cancelIcon: 'p-rating-icon p-rating-cancel',
item: ({ instance, props, value }) => [
'p-rating-item',
{
'p-rating-item-active': value <= props.modelValue,
2024-03-26 07:28:22 +00:00
'p-focus-visible': value === instance.focusedOptionIndex && instance.isFocusVisibleItem
}
],
onIcon: 'p-rating-icon',
offIcon: 'p-rating-icon'
};
export default BaseStyle.extend({
name: 'rating',
classes
});