2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-rating',
|
|
|
|
{
|
|
|
|
'p-readonly': props.readonly,
|
|
|
|
'p-disabled': props.disabled
|
|
|
|
}
|
|
|
|
],
|
|
|
|
item: ({ instance, props, value }) => [
|
2024-04-07 10:55:28 +00:00
|
|
|
'p-rating-option',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-07 10:55:28 +00:00
|
|
|
'p-rating-option-active': value <= props.modelValue,
|
2024-03-26 07:28:22 +00:00
|
|
|
'p-focus-visible': value === instance.focusedOptionIndex && instance.isFocusVisibleItem
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-07 10:55:28 +00:00
|
|
|
onIcon: 'p-rating-icon p-rating-on-icon',
|
|
|
|
offIcon: 'p-rating-icon p-rating-off-icon'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'rating',
|
|
|
|
classes
|
|
|
|
});
|