From 69325de4e8b347399e4fa03ac2b1270b26734045 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Sun, 7 Apr 2024 13:55:28 +0300 Subject: [PATCH] Refactored Rating --- components/lib/rating/style/RatingStyle.js | 8 ++++---- components/lib/themes/primeone/base/rating/index.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/lib/rating/style/RatingStyle.js b/components/lib/rating/style/RatingStyle.js index 80f428b9e..9ba20e2e7 100644 --- a/components/lib/rating/style/RatingStyle.js +++ b/components/lib/rating/style/RatingStyle.js @@ -16,14 +16,14 @@ const classes = { ], cancelIcon: 'p-rating-icon p-rating-cancel', item: ({ instance, props, value }) => [ - 'p-rating-item', + 'p-rating-option', { - 'p-rating-item-active': value <= props.modelValue, + 'p-rating-option-active': value <= props.modelValue, 'p-focus-visible': value === instance.focusedOptionIndex && instance.isFocusVisibleItem } ], - onIcon: 'p-rating-icon', - offIcon: 'p-rating-icon' + onIcon: 'p-rating-icon p-rating-on-icon', + offIcon: 'p-rating-icon p-rating-off-icon' }; export default BaseStyle.extend({ diff --git a/components/lib/themes/primeone/base/rating/index.js b/components/lib/themes/primeone/base/rating/index.js index 7a76b776c..b2d2f062c 100644 --- a/components/lib/themes/primeone/base/rating/index.js +++ b/components/lib/themes/primeone/base/rating/index.js @@ -7,7 +7,7 @@ export default { gap: 0.25rem; } -.p-rating-item { +.p-rating-option { display: inline-flex; align-items: center; cursor: pointer; @@ -16,7 +16,7 @@ export default { cursor: pointer; } -.p-rating-item.p-focus-visible { +.p-rating-option.p-focus-visible { outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; outline-offset: ${dt('focus.ring.offset')}; } @@ -29,11 +29,11 @@ export default { height: 1rem; } -.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-item:hover .p-rating-icon { +.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-option:hover .p-rating-icon { color: ${dt('rating.icon.hover.color')}; } -.p-rating-item-active .p-rating-icon { +.p-rating-option-active .p-rating-icon { color: ${dt('rating.icon.active.color')}; } `