primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
138 lines (137 loc) • 5.18 kB
TypeScript
import { EventEmitter, OnInit, QueryList, TemplateRef } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { PrimeTemplate } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { Nullable } from 'primeng/ts-helpers';
import { RatingRateEvent } from './rating.interface';
import { RatingStyle } from './style/ratingstyle';
import * as i0 from "@angular/core";
import * as i1 from "primeng/api";
export declare const RATING_VALUE_ACCESSOR: any;
/**
* Rating is an extension to standard radio button element with theming.
* @group Components
*/
export declare class Rating extends BaseComponent implements OnInit, ControlValueAccessor {
/**
* When present, it specifies that the element should be disabled.
* @group Props
*/
disabled: boolean | undefined;
/**
* When present, changing the value is not possible.
* @group Props
*/
readonly: boolean | undefined;
/**
* Number of stars.
* @group Props
*/
stars: number;
/**
* Style class of the on icon.
* @group Props
*/
iconOnClass: string | undefined;
/**
* Inline style of the on icon.
* @group Props
*/
iconOnStyle: {
[klass: string]: any;
} | null | undefined;
/**
* Style class of the off icon.
* @group Props
*/
iconOffClass: string | undefined;
/**
* Inline style of the off icon.
* @group Props
*/
iconOffStyle: {
[klass: string]: any;
} | null | undefined;
/**
* When present, it specifies that the component should automatically get focus on load.
* @group Props
*/
autofocus: boolean | undefined;
/**
* Emitted on value change.
* @param {RatingRateEvent} value - Custom rate event.
* @group Emits
*/
onRate: EventEmitter<RatingRateEvent>;
/**
* Emitted when the rating is cancelled.
* @param {Event} value - Browser event.
* @group Emits
*/
onCancel: EventEmitter<Event>;
/**
* Emitted when the rating receives focus.
* @param {Event} value - Browser event.
* @group Emits
*/
onFocus: EventEmitter<FocusEvent>;
/**
* Emitted when the rating loses focus.
* @param {Event} value - Browser event.
* @group Emits
*/
onBlur: EventEmitter<FocusEvent>;
/**
* Custom on icon template.
* @group Templates
*/
onIconTemplate: Nullable<TemplateRef<any>>;
/**
* Custom off icon template.
* @group Templates
*/
offIconTemplate: Nullable<TemplateRef<any>>;
/**
* Custom cancel icon template.
* @group Templates
*/
cancelIconTemplate: Nullable<TemplateRef<any>>;
templates: QueryList<PrimeTemplate>;
value: Nullable<number>;
onModelChange: Function;
onModelTouched: Function;
starsArray: Nullable<number[]>;
isFocusVisibleItem: boolean;
focusedOptionIndex: import("@angular/core").WritableSignal<number>;
nameattr: string | undefined;
_componentStyle: RatingStyle;
_onIconTemplate: TemplateRef<any> | undefined;
_offIconTemplate: TemplateRef<any> | undefined;
_cancelIconTemplate: TemplateRef<any> | undefined;
ngOnInit(): void;
ngAfterContentInit(): void;
onOptionClick(event: any, value: any): void;
onOptionSelect(event: any, value: any): void;
onChange(event: any, value: any): void;
onInputBlur(event: any): void;
onInputFocus(event: any, value: any): void;
updateModel(event: any, value: any): void;
starAriaLabel(value: any): string;
getIconTemplate(i: number): Nullable<TemplateRef<any>>;
writeValue(value: any): void;
registerOnChange(fn: Function): void;
registerOnTouched(fn: Function): void;
setDisabledState(val: boolean): void;
get isCustomIcon(): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<Rating, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<Rating, "p-rating", never, { "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "stars": { "alias": "stars"; "required": false; }; "iconOnClass": { "alias": "iconOnClass"; "required": false; }; "iconOnStyle": { "alias": "iconOnStyle"; "required": false; }; "iconOffClass": { "alias": "iconOffClass"; "required": false; }; "iconOffStyle": { "alias": "iconOffStyle"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; }, { "onRate": "onRate"; "onCancel": "onCancel"; "onFocus": "onFocus"; "onBlur": "onBlur"; }, ["onIconTemplate", "offIconTemplate", "cancelIconTemplate", "templates"], never, true, never>;
static ngAcceptInputType_disabled: unknown;
static ngAcceptInputType_readonly: unknown;
static ngAcceptInputType_stars: unknown;
static ngAcceptInputType_autofocus: unknown;
}
export declare class RatingModule {
static ɵfac: i0.ɵɵFactoryDeclaration<RatingModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<RatingModule, never, [typeof Rating, typeof i1.SharedModule], [typeof Rating, typeof i1.SharedModule]>;
static ɵinj: i0.ɵɵInjectorDeclaration<RatingModule>;
}