import { JSXInterface } from '../jsx'; import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core'; /** * Star visualisation component that is generally used for ranking * @fires value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically. */ export declare class Rating extends BasicElement { /** * Element version number * @returns version number */ static get version(): string; /** * A `CSSResultGroup` that will be used * to style the host, slotted children * and the internal template of the element. * @returns CSS template */ static get styles(): CSSResultGroup; private MAX_VALUE; private MIN_VALUE; /** * Make it possible to interact with rating control and change the value */ interactive: boolean; /** * Internal max value of rating. * Controlled by public setter and getter */ private _max; /** * Set number of total stars * @param max max value * @default '5' */ set max(max: string); get max(): string; /** * Converts max value from string to number for calculations * @returns maximum value of rating as a number */ private get maxNumber(); /** * Internal value of rating. * Controlled by public setter and getter */ private _value; /** * Set number of selected stars. Value can be any number between 0 and `max`. * Decimal values are calculated to empty star (0 - .25); half-star (.25 - .75) and full star (.75 - 1) * @param value Element value * @default '0' */ set value(value: string); get value(): string; /** * Converts value from string to number for calculations * @returns value of rating as a number */ private get valueNumber(); /** * Called before update() to compute values needed during the update. * @param changedProperties Properties that has changed * @returns {void} */ protected willUpdate(changedProperties: PropertyValues): void; /** * Invoked when the element is first updated * @param changedProperties changed properties * @returns {void} */ protected firstUpdated(changedProperties: PropertyValues): void; /** * Handles interactive and aria attribute changes * @returns {void} */ private interactiveChanged; /** * Handles key input * @param event Key down event object * @returns {void} */ protected onKeyDown(event: KeyboardEvent): void; /** * Update value and fired value-changed event * @param value value to updated * @returns {void} */ private notifyValueChange; /** * Check if passed value is a valid value * @override * @param value Value to check * @returns {boolean} false if value is invalid */ protected isValidValue(value: string): boolean; /** * Increases the value of rating by half or 1 if not specific amount but not exceed max value * @param value step up value to specific number (optional) * @returns {void} */ private stepUp; /** * Decrease the value of rating by half or 1 if not specific amount but not exceed min value * @param value step down value to specific number (optional) * @returns {void} */ private stepDown; /** * Process click event to set the new value * @param {number} index index of star * @returns {void} */ private handleTap; /** * Render rating based on max number of stars and value. * Note: to speed up the component, hover state is implemented using CSS only. * CSS3 specification does not allow to select items preceding the hover, but allows to select the following items. * Therefore `flex: reverse` style is applied and the items are constructed in the reverse mode to mimic the correct behaviour. * @returns stars template */ private get starsTemplate(); /** * A `TemplateResult` that will be used * to render the updated internal template. * @return Render template */ protected render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { 'ef-rating': Rating; } } declare global { interface HTMLElementTagNameMap { 'ef-rating': Rating; } namespace JSX { interface IntrinsicElements { 'ef-rating': Partial | JSXInterface.HTMLAttributes; } } } export {};