packages/ecl/components/ecl-rating-field/ecl-rating-field.component.ts
Component representing rating field, displayed with stars. Typically used when the user needs to evaluate something.
| providers |
ECL_RATINGFIELD_VALUE_ACCESSOR
|
| selector | ecl-rating-field |
| imports |
EUI_ECL_ICON
|
| templateUrl | ./ecl-rating-field.component.html |
Methods |
Inputs |
Outputs |
HostBindings |
Accessors |
| disabled |
Type : boolean
|
|
Can be used to set disabled status. |
| name |
Type : string
|
Default value : 'rating'
|
|
Name of the radio group. Also used for creating id for each radio button. |
| numberOfStars |
Type : number
|
Default value : 5
|
|
How many stars should the rating have. |
| rating |
Type : number
|
|
The initial value, if any. |
| class |
Type : string
|
| e2eAttr |
Type : any
|
| tabindex |
Type : number
|
| ratingChange |
Type : EventEmitter
|
|
The event to be emitted when rating is changed. |
| class |
Type : string
|
|
Applies the base class |
| onRadioClick | ||||||||
onRadioClick(rating: number)
|
||||||||
|
Method that sets the new rating and emit 'ratingChange' event, that includes the new rating number.
Parameters :
Returns :
void
|
| registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
|
Parameters :
Returns :
void
|
| registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
|
Parameters :
Returns :
void
|
| setDisabledState | ||||||
setDisabledState(isDisabled: boolean)
|
||||||
|
Disable/enable component.
Parameters :
Returns :
void
|
| writeValue | ||||||
writeValue(value: number)
|
||||||
|
Informs the component of any changes in the parent (ControlValueAccessor). Sets the new value for the 'rating' property.
Parameters :
Returns :
void
|
| getCssClasses | ||||||
getCssClasses(rootClass: string)
|
||||||
|
Parameters :
Returns :
string
|
| numbers |
getnumbers()
|
|
Array of numbers, from 1 to 'numberOfStars'
Returns :
Array<number>
|
| cssClasses |
getcssClasses()
|
|
Applies the base class
Returns :
string
|