Fixed #1836 - For Rating

pull/1846/head
mertsincan 2021-12-01 17:11:11 +03:00
parent ce0c8d6f96
commit 2b3e3010bf
1 changed files with 67 additions and 10 deletions

View File

@ -1,15 +1,72 @@
interface RatingProps { import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
modelValue?: number;
disabled?: boolean; export interface RatingChangeEvent {
readonly?: boolean; /**
stars?: number; * Browser event
cancel?: boolean; */
originalEvent: Event;
/**
* Selected option value
*/
value: number;
} }
declare class Rating { export interface RatingProps {
$props: RatingProps; /**
$emit(eventName: 'update:modelValue', value: number): this; * Value of the rating.
$emit(eventName: 'change', e: { originalEvent: Event, value: any }): this; */
modelValue?: number | undefined;
/**
* When present, it specifies that the element should be disabled.
*/
disabled?: boolean | undefined;
/**
* When present, it specifies that component is read-only.
*/
readonly?: boolean | undefined;
/**
* Number of stars.
* Default value is 5.
*/
stars?: number | undefined;
/**
* When specified a cancel icon is displayed to allow clearing the value.
* Default value is true.
*/
cancel?: boolean | undefined;
} }
export interface RatingSlots {
}
export declare type RatingEmits = {
/**
* Emitted when the value changes.
* @param {number} value - New value.
*/
'update:modelValue': (value: number) => void;
/**
* Callback to invoke when a suggestion is selected.
* @param {RatingChangeEvent} event - Custom change event.
*/
'change': (event: RatingChangeEvent) => void;
}
declare class Rating extends ClassComponent<RatingProps, RatingSlots, RatingEmits> { }
declare module '@vue/runtime-core' {
interface GlobalComponents {
Rating: GlobalComponentConstructor<Rating>
}
}
/**
*
* Rating component is a star based selection input.
*
* Demos:
*
* - [Rating](https://www.primefaces.org/primevue/showcase/#/rating)
*
*/
export default Rating; export default Rating;