mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3922 - For SelectButton
This commit is contained in:
parent
802714768b
commit
73327316aa
7 changed files with 171 additions and 4 deletions
51
components/lib/selectbutton/SelectButton.d.ts
vendored
51
components/lib/selectbutton/SelectButton.d.ts
vendored
|
@ -10,6 +10,42 @@
|
|||
import { VNode } from 'vue';
|
||||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
||||
|
||||
export declare type SelectButtonPassThroughOptionType = SelectButtonPassThroughAttributes | ((options: SelectButtonPassThroughMethodOptions) => SelectButtonPassThroughAttributes) | null | undefined;
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) option method.
|
||||
*/
|
||||
export interface SelectButtonPassThroughMethodOptions {
|
||||
props: SelectButtonProps;
|
||||
state: SelectButtonState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) options.
|
||||
* @see {@link SelectButtonProps.pt}
|
||||
*/
|
||||
export interface SelectButtonPassThroughOptions {
|
||||
/**
|
||||
* Uses to pass attributes to the root's DOM element.
|
||||
*/
|
||||
root?: SelectButtonPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the button's DOM element.
|
||||
*/
|
||||
button?: SelectButtonPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the label's DOM element.
|
||||
*/
|
||||
label?: SelectButtonPassThroughOptionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough attributes for each DOM elements
|
||||
*/
|
||||
export interface SelectButtonPassThroughAttributes {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom change event.
|
||||
* @see {@link SelectButtonEmits.change}
|
||||
|
@ -25,6 +61,16 @@ export interface SelectButtonChangeEvent {
|
|||
value: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines current inline state in SelectButton component.
|
||||
*/
|
||||
export interface SelectButtonState {
|
||||
/**
|
||||
* FocusedIndex state as a number.
|
||||
*/
|
||||
focusedIndex: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines valid properties in SelectButton component.
|
||||
*/
|
||||
|
@ -72,6 +118,11 @@ export interface SelectButtonProps {
|
|||
* Identifier of the underlying element.
|
||||
*/
|
||||
'aria-labelledby'?: string | undefined;
|
||||
/**
|
||||
* Uses to pass attributes to DOM elements inside the component.
|
||||
* @type {SelectButtonPassThroughOptions}
|
||||
*/
|
||||
pt?: SelectButtonPassThroughOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue