Refactor #3922 - For Rating

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-09 11:34:26 +03:00
parent d511c6155c
commit f22ae855a1
2 changed files with 47 additions and 26 deletions

View file

@ -18,6 +18,7 @@ export declare type RatingPassThroughOptionType = RatingPassThroughAttributes |
export interface RatingPassThroughMethodOptions {
props: RatingProps;
state: RatingState;
context: RatingContext;
}
/**
@ -29,18 +30,6 @@ export interface RatingPassThroughOptions {
* Uses to pass attributes to the root's DOM element.
*/
root?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the cancel item's DOM element.
*/
cancelItem?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the input aria's DOM element.
*/
cancelInputAria?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the cancel input's DOM element.
*/
cancelInput?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the cancel icon's DOM element.
*/
@ -49,14 +38,6 @@ export interface RatingPassThroughOptions {
* Uses to pass attributes to the item's DOM element.
*/
item?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the item input aria's DOM element.
*/
itemInputAria?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the item input's DOM element.
*/
itemInput?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the on icon's DOM element.
*/
@ -65,6 +46,22 @@ export interface RatingPassThroughOptions {
* Uses to pass attributes to the off icon's DOM element.
*/
offIcon?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the hidden cancel inputW wapper's DOM element.
*/
hiddenCancelInputWrapper?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the hidden cancel input's DOM element.
*/
hiddenCancelInput?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the hidden item input wrapper's DOM element.
*/
hiddenItemInputWrapper?: RatingPassThroughOptionType;
/**
* Uses to pass attributes to the hidden item input's DOM element.
*/
hiddenItemInput?: RatingPassThroughOptionType;
}
/**
@ -88,6 +85,22 @@ export interface RatingState {
focusedOptionIndex: number;
}
/**
* Defines current options in Rating component.
*/
export interface RatingContext {
/**
* Current active state of the item as a boolean.
* @defaultValue false
*/
active: boolean;
/**
* Current focused state of menuitem as a boolean.
* @defaultValue false
*/
focused: boolean;
}
/**
* Custom change event.
* @see {@link RatingEmits.change}