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'
41
41
const CLASS_NAME_RATING_ITEM_CUSTOM_ICON_ACTIVE = 'rating-item-custom-icon-active'
42
42
const CLASS_NAME_RATING_ITEM_INPUT = 'rating-item-input'
43
43
const CLASS_NAME_RATING_ITEM_LABEL = 'rating-item-label'
44
+ const CLASS_NAME_READONLY = 'readonly'
44
45
45
46
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="rating"]'
46
47
const SELECTOR_RATING_ITEM_INPUT = '.rating-item-input'
@@ -355,6 +356,10 @@ class Rating extends BaseComponent {
355
356
this . _element . classList . add ( CLASS_NAME_DISABLED )
356
357
}
357
358
359
+ if ( this . _config . readOnly ) {
360
+ this . _element . classList . add ( CLASS_NAME_READONLY )
361
+ }
362
+
358
363
this . _element . setAttribute ( 'role' , 'radiogroup' )
359
364
Array . from ( { length : this . _config . itemCount } , ( _ , index ) => this . _createRatingItem ( index ) )
360
365
}
Original file line number Diff line number Diff line change 17
17
}
18
18
19
19
& :not (.disabled ):not (.readonly ) {
20
- .rating-item {
21
- cursor : pointer ;
20
+ .rating-item :hover {
21
+ transform : var (--#{$prefix}rating-item-scale-transform );
22
+ }
22
23
23
- & :hover {
24
- transform : var ( --#{$prefix} rating-item-scale-transform );
25
- }
24
+ .rating-item-icon ,
25
+ . rating-item-label {
26
+ cursor : pointer ;
26
27
}
27
28
}
28
29
}
47
48
font-size : var (--#{$prefix}rating-item-height );
48
49
line-height : 0 ;
49
50
color : var (--#{$prefix}rating-item-color );
50
- cursor : pointer ;
51
51
52
52
* {
53
53
pointer-events : none ;
83
83
.rating-item-icon {
84
84
width : var (--#{$prefix}rating-item-height );
85
85
height : var (--#{$prefix}rating-item-height );
86
- cursor : pointer ;
87
86
background-color : var (--#{$prefix}rating-item-color );
88
87
mask : var (--#{$prefix}rating-item-icon ) center / var (--#{$prefix}rating-item-height ) no-repeat ;
89
88
}
You can’t perform that action at this time.
0 commit comments