File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ const CLASS_NAME_RATING_ITEM_CUSTOM_ICON = 'rating-item-custom-icon'
4141const CLASS_NAME_RATING_ITEM_CUSTOM_ICON_ACTIVE = 'rating-item-custom-icon-active'
4242const CLASS_NAME_RATING_ITEM_INPUT = 'rating-item-input'
4343const CLASS_NAME_RATING_ITEM_LABEL = 'rating-item-label'
44+ const CLASS_NAME_READONLY = 'readonly'
4445
4546const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="rating"]'
4647const SELECTOR_RATING_ITEM_INPUT = '.rating-item-input'
@@ -355,6 +356,10 @@ class Rating extends BaseComponent {
355356 this . _element . classList . add ( CLASS_NAME_DISABLED )
356357 }
357358
359+ if ( this . _config . readOnly ) {
360+ this . _element . classList . add ( CLASS_NAME_READONLY )
361+ }
362+
358363 this . _element . setAttribute ( 'role' , 'radiogroup' )
359364 Array . from ( { length : this . _config . itemCount } , ( _ , index ) => this . _createRatingItem ( index ) )
360365 }
Original file line number Diff line number Diff line change 1717 }
1818
1919 & :not (.disabled ):not (.readonly ) {
20- .rating-item {
21- cursor : pointer ;
20+ .rating-item :hover {
21+ transform : var (--#{$prefix}rating-item-scale-transform );
22+ }
2223
23- & :hover {
24- transform : var ( --#{$prefix} rating-item-scale-transform );
25- }
24+ .rating-item-icon ,
25+ . rating-item-label {
26+ cursor : pointer ;
2627 }
2728 }
2829}
4748 font-size : var (--#{$prefix}rating-item-height );
4849 line-height : 0 ;
4950 color : var (--#{$prefix}rating-item-color );
50- cursor : pointer ;
5151
5252 * {
5353 pointer-events : none ;
8383.rating-item-icon {
8484 width : var (--#{$prefix}rating-item-height );
8585 height : var (--#{$prefix}rating-item-height );
86- cursor : pointer ;
8786 background-color : var (--#{$prefix}rating-item-color );
8887 mask : var (--#{$prefix}rating-item-icon ) center / var (--#{$prefix}rating-item-height ) no-repeat ;
8988}
You can’t perform that action at this time.
0 commit comments