mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3889 - For Button
This commit is contained in:
parent
c9f6c31462
commit
bd48603c39
3 changed files with 62 additions and 6 deletions
48
components/lib/button/Button.d.ts
vendored
48
components/lib/button/Button.d.ts
vendored
|
@ -10,6 +10,49 @@
|
|||
import { ButtonHTMLAttributes, VNode } from 'vue';
|
||||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
||||
|
||||
export declare type ButtonPassThroughOptionType = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions) => ButtonPassThroughAttributes) | null | undefined;
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) option method.
|
||||
*/
|
||||
export interface ButtonPassThroughMethodOptions {
|
||||
props: ButtonProps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) options.
|
||||
* @see {@link ButtonProps.pt}
|
||||
*/
|
||||
export interface ButtonPassThroughOptions {
|
||||
/**
|
||||
* Uses to pass attributes to the root's DOM element.
|
||||
*/
|
||||
root?: ButtonPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the loading icon's DOM element.
|
||||
*/
|
||||
loadingIcon?: ButtonPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the icon's DOM element.
|
||||
*/
|
||||
icon?: ButtonPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the label's DOM element.
|
||||
*/
|
||||
label?: ButtonPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the badge's DOM element.
|
||||
*/
|
||||
badge?: ButtonPassThroughOptionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough attributes for each DOM elements
|
||||
*/
|
||||
export interface ButtonPassThroughAttributes {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines valid properties in Button component.
|
||||
*/
|
||||
|
@ -94,6 +137,11 @@ export interface ButtonProps extends ButtonHTMLAttributes {
|
|||
* @defaultValue false
|
||||
*/
|
||||
plain?: boolean | undefined;
|
||||
/**
|
||||
* Uses to pass attributes to DOM elements inside the component.
|
||||
* @type {ButtonPassThroughOptions}
|
||||
*/
|
||||
pt?: ButtonPassThroughOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue