@@ -15,11 +15,22 @@ export default {
15
15
description :
16
16
'CSS color to use instead of variant. Accepts either a HEX or RGB/RGBA string' ,
17
17
} ,
18
+ inline : {
19
+ type : 'boolean' ,
20
+ default : 'false' ,
21
+ description :
22
+ 'When `true` renders as an inline element rather than a block (100% width) element' ,
23
+ } ,
18
24
modelValue : {
19
25
type : 'number' ,
20
26
default : 0 ,
21
27
description : 'The current rating value (supports v-model two-way binding).' ,
22
28
} ,
29
+ noBorder : {
30
+ type : 'boolean' ,
31
+ default : 'false' ,
32
+ description : 'When `true`, removes the border around the rating component' ,
33
+ } ,
23
34
precision : {
24
35
type : 'number' ,
25
36
default : undefined ,
@@ -31,7 +42,12 @@ export default {
31
42
default : 'false' ,
32
43
description :
33
44
'When `true` makes the rating readonly. When `true`, fractional ratings values are allowed (half icons will be shown)' ,
34
- } , //
45
+ } ,
46
+ showClear : {
47
+ type : 'boolean' ,
48
+ default : 'false' ,
49
+ description : 'When `true`, shows a clear button to reset the rating' ,
50
+ } ,
35
51
showValue : {
36
52
type : 'boolean' ,
37
53
default : 'false' ,
@@ -43,57 +59,18 @@ export default {
43
59
description :
44
60
'When set to `true` and prop `show-value` is `true`, includes the maximum star rating possible in the formatted value' ,
45
61
} ,
46
- stars : {
47
- type : 'number' ,
48
- default : '5' ,
49
- description : 'The number of stars to show. Minimum value is `3`, default is `5`' ,
50
- } ,
51
- variant : {
52
- type : 'string' ,
53
- default : undefined ,
54
- description : 'Applies one of the Bootstrap theme color variants to the component' ,
55
- } ,
56
62
size : {
57
- type : 'string' ,
63
+ type : "'sm' | 'lg' | string" ,
58
64
default : '1rem' ,
59
65
description :
60
66
"Icon size: accepts CSS units (e.g. '1.5rem', '24px') or the presets 'sm' (.875rem) and 'lg' (1.25rem); defaults to 1rem." ,
61
67
} ,
62
- noBorder : {
63
- type : 'boolean' ,
64
- default : 'false' ,
65
- description : 'When `true`, removes the border around the rating component' ,
66
- } ,
67
- showClear : {
68
- type : 'boolean' ,
69
- default : 'false' ,
70
- description : 'When `true`, shows a clear button to reset the rating' ,
71
- } ,
72
- iconFull : {
73
- type : 'string' ,
74
- default : undefined ,
75
- description :
76
- 'Icon name or component to use for filled stars when using custom slot rendering' ,
77
- } ,
78
- iconHalf : {
79
- type : 'string' ,
80
- default : undefined ,
81
- description :
82
- 'Icon name or component to use for half-filled stars when using custom slot rendering' ,
83
- } ,
84
- iconEmpty : {
85
- type : 'string' ,
86
- default : undefined ,
87
- description :
88
- 'Icon name or component to use for empty stars when using custom slot rendering' ,
89
- } ,
90
- inline : {
91
- type : 'boolean' ,
92
- default : 'false' ,
93
- description :
94
- 'When `true` renders as an inline element rather than a block (100% width) element' ,
68
+ stars : {
69
+ type : 'number' ,
70
+ default : 5 ,
71
+ description : 'The number of stars to show. Minimum value is `3`, default is `5`' ,
95
72
} ,
96
- ...pick ( buildCommonProps ( ) , [ 'form' , ' id', 'name ' ] ) ,
73
+ ...pick ( buildCommonProps ( ) , [ 'id' , 'variant ' ] ) ,
97
74
} satisfies Record < keyof BvnComponentProps [ 'BFormRating' ] , PropertyReference > ,
98
75
} ,
99
76
emits : [
@@ -113,8 +90,24 @@ export default {
113
90
slots : [
114
91
{
115
92
name : 'default' ,
116
- description :
117
- 'Custom renderer for each star. Receives `starIndex`, `isFilled`, `isHalf`, `iconFull`, `iconHalf`, and `iconEmpty` as slot-scope props.' ,
93
+ description : 'Custom renderer for each star.' ,
94
+ scope : [
95
+ {
96
+ prop : 'starIndex' ,
97
+ type : 'number' ,
98
+ description : 'The index of the star being rendered (0-based index)' ,
99
+ } ,
100
+ {
101
+ prop : 'isFilled' ,
102
+ type : 'boolean' ,
103
+ description : 'When `true`, the star is filled (selected)' ,
104
+ } ,
105
+ {
106
+ prop : 'isHalf' ,
107
+ type : 'boolean' ,
108
+ description : 'When `true`, the star is half-filled (partially selected)' ,
109
+ } ,
110
+ ] ,
118
111
} ,
119
112
] ,
120
113
} ,
0 commit comments