dap-design-system
Version:
Official design system for the DÁP (dap.gov.hu)
56 lines (55 loc) • 1.91 kB
TypeScript
import { GenericFormElement } from '../../internal/mixin/genericFormElement';
import { default as DapDSIcon } from '../icon/icon.component';
/**
* `dap-ds-rating`
* @summary Rating is a component that allows users to rate a product or service.
* @element dap-ds-rating
* @title - Rating
*
* @event {{ value: number }} dds-change - Event fired when the rating value changes.
*
* @csspart base - The main rating container.
* @csspart star - The star element.
* @csspart stars-container - The container of the stars.
* @csspart icon - The icon of the star.
*/
export default class DapDSRating extends GenericFormElement {
static tagName: string;
static dependencies: {
'dap-ds-icon': typeof DapDSIcon;
};
/** Reference to the live region for screen reader announcements */
private readonly _liveRegion;
constructor();
static readonly styles: import('lit').CSSResult;
/** The label of the rating */
label: string;
/** The maximum number of stars */
max: number;
private _ratingContainer;
private _hasFocus;
private _hoverValue;
private readonly _uniqueId;
connectedCallback(): void;
disconnectedCallback(): void;
firstUpdated(): void;
_handleContainerFocus: () => void;
_handleContainerBlur: () => void;
_handleContainerKeyDown: (event: KeyboardEvent) => void;
/**
* Handle keyboard events for the entire component
* This is a backup to catch keyboard events if they bubble up
*/
_handleKeyDown: (event: KeyboardEvent) => void;
_incrementRating(): void;
_decrementRating(): void;
_setRating(value: number): void;
/**
* Announce the current rating to screen readers
*/
_announceRating(): void;
_handleStarClick(value: number): void;
_handleStarHover(value: number): void;
_handleStarLeave(): void;
render(): import('lit-html').TemplateResult;
}