packages/components/eui-rating/eui-rating.component.ts
Rating component that can be used as a standalone start rating or within reactive forms.
ControlValueAccessor
OnInit
AfterViewInit
OnDestroy
| changeDetection | ChangeDetectionStrategy.OnPush |
| HostDirectives |
BaseStatesDirective
|
| providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => EuiRatingComponent), multi: true,
}
|
| selector | eui-rating |
| imports |
ReactiveFormsModule
EUI_ICON
EUI_BUTTON
|
| templateUrl | ./eui-rating.component.html |
| styleUrl | ./eui-rating.scss |
Properties |
Methods |
|
Inputs |
Outputs |
HostBindings |
Accessors |
| ariaLabel |
Type : string
|
Default value : 'eUI Rating'
|
|
Binds the aria-label attribute to the component. |
| euiDisabled |
Type : boolean
|
Default value : false
|
|
Whether the toggle is disabled |
| numberOfStars |
Type : number
|
Default value : 5
|
|
Current numbers of stars rating to display |
| rating |
Type : number
|
Default value : 0
|
|
Current rating number |
| ratingChange |
Type : EventEmitter
|
|
Event emitted when toggle state changes |
| attr.role |
Type : string
|
Default value : 'radiogroup'
|
|
Binds the role attribute to the component. |
| class |
Type : string
|
|
CSS classes applied to the host element |
| Public onFocusOut |
onFocusOut()
|
|
Handles focus out event Notifies form control of touch event
Returns :
void
|
| Public registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
|
Implements ControlValueAccessor Registers change handler
Parameters :
Returns :
void
|
| Public registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
|
Implements ControlValueAccessor Registers touch handler
Parameters :
Returns :
void
|
| Public setDisabledState | ||||||
setDisabledState(isDisabled: boolean)
|
||||||
|
Implements ControlValueAccessor Updates the rating's disabled state
Parameters :
Returns :
void
|
| Public writeValue | ||||||
writeValue(value: number)
|
||||||
|
Implements ControlValueAccessor Updates the toggle's checked state
Parameters :
Returns :
void
|
| ratingButtons |
Type : QueryList<ElementRef>
|
Decorators :
@ViewChildren('euiRatingButtonRef', {read: ElementRef})
|
| role |
Type : string
|
Default value : 'radiogroup'
|
Decorators :
@HostBinding('attr.role')
|
|
Binds the role attribute to the component. |
| cssClasses |
getcssClasses()
|
|
CSS classes applied to the host element
Returns :
string
|