primevue-mirror/components/button/Button.d.ts

78 lines
1.9 KiB
TypeScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { ButtonHTMLAttributes, VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type ButtonIconPosType = 'left' | 'right' | 'top' | 'bottom' | undefined;
export interface ButtonProps extends ButtonHTMLAttributes {
/**
* Inline style of the button.
*/
style?: any;
/**
2022-09-14 11:26:01 +00:00
* Style class of the button.
*/
2022-09-06 12:03:37 +00:00
class?: any;
/**
* Text of the button.
*/
label?: string | undefined;
/**
* Name of the icon.
*/
icon?: string | undefined;
/**
* Position of the icon, valid values are 'left', 'right', 'bottom' and 'top'.
* Default value is 'left'.
*/
iconPos?: ButtonIconPosType;
2022-09-14 11:26:01 +00:00
/**
* Style class of the icon.
*/
iconClass?: string | undefined;
2022-09-06 12:03:37 +00:00
/**
* Value of the badge.
*/
badge?: string | undefined;
/**
* Style class of the badge.
*/
badgeClass?: string | undefined;
/**
* Whether the button is in loading state.
*/
loading?: boolean | undefined;
/**
* Icon to display in loading state.
* Default value is 'pi pi-spinner pi-spin'.
*/
loadingIcon?: string | undefined;
}
export interface ButtonSlots {
/**
* Custom content such as icons, images and text can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included.
*/
default: () => VNode[];
}
2022-09-14 11:26:01 +00:00
export declare type ButtonEmits = {};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class Button extends ClassComponent<ButtonProps, ButtonSlots, ButtonEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Button: GlobalComponentConstructor<Button>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* Button is an extension to standard button element with icons and theming.
*
* Demos:
*
2022-09-14 11:26:01 +00:00
* - [Button](https://www.primefaces.org/primevue/button)
2022-09-06 12:03:37 +00:00
*
*/
export default Button;