import { ElementRef, OnInit } from '@angular/core'; import { CfCoreComponent } from '../core/core.component'; import { RatingModel } from '../../models/rating/rating.model'; import { RatingStylingModel } from '../../models/rating/rating-styling.model'; /** *

Rating component which has vertical/horizontal icons, icon order changing and other basic functionality.

*

Example of using Menu:

*
 * <cf-rating [properties]="myRating" [styling]="myRatingStyles"></cf-rating>
 * 
*/ export declare class CfRatingComponent extends CfCoreComponent implements OnInit { elementRef: ElementRef; /** * It is an RatingModel object with options to be rendered into component template */ cfRating: RatingModel; /** * It is an array to be filled with items according to MAX property */ cfItems: number[]; /** * It is an attribute [properties] of directive cf-rating which take RatingModel object. *

Example of Rating json object:

*
{
     *  label: 'Rating label',
     *  icon: 'stars',
     *  value: 1,
     *  max: 5,
     *  countFromEnd: false,
     *  iconsVertical: false
     *  disabled: false
     * }
*

label: string

* Label for component *

icon: string

* Name of icon *

value: number

* Value of rating and means number of filled/selected icons *

max: number

* Number of rating icons *

countFromEnd: boolean

* Means to start icons counting order *

iconsVertical: boolean

* Means to show icons vertically *

disabled: boolean

* Means component to be disabled */ properties: RatingModel; /** * It is an object with styling component elements RatingStylingModel object */ styling: RatingStylingModel; constructor(elementRef: ElementRef); /** * Initialize all data */ ngOnInit(): void; /** * Function to set component value * @param index it is used to calculate component value */ private setRating(index); /** * Function to unselect current item by user double-click and change component value * @param index it is used to calculate component value */ private resetCurrentItem(index); /** * Function to set filled color for icons */ private getHighlitedColor(); /** * Function to set empty color for icons */ private getEmptyColor(); }