ToggleButton d.ts updated

pull/3689/head
mertsincan 2023-03-01 11:19:19 +00:00
parent 69cdcaa8d4
commit fdb53fffeb
1 changed files with 42 additions and 22 deletions

View File

@ -1,11 +1,22 @@
/**
*
* ToggleButton is used to select a boolean value using a button.
*
* [Live Demo](https://www.primevue.org/togglebutton/)
*
* @module togglebutton
*
*/
import { InputHTMLAttributes } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type ToggleButtonType = 'left' | 'right' | undefined;
/**
* Defines valid properties in ToggleButton component.
*/
export interface ToggleButtonProps {
/**
* Value of the component.
* @defaultValue false
*/
modelValue?: boolean | undefined;
/**
@ -18,22 +29,22 @@ export interface ToggleButtonProps {
offIcon?: string | undefined;
/**
* Label for the on state.
* Default value is 'yes'.
* @defaultValue yes
*/
onLabel?: string | undefined;
/**
* Label for the off state.
* Default value is 'no'.
* @defaultValue no
*/
offLabel?: string | undefined;
/**
* Position of the icon.
* @see ToggleButtonType
* Default value is 'left'.
* @defaultValue left
*/
iconPos?: ToggleButtonType;
iconPos?: 'left' | 'right' | undefined;
/**
* When present, it specifies that the element should be disabled.
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
@ -66,31 +77,49 @@ export interface ToggleButtonProps {
'aria-label'?: string | undefined;
}
/**
* Defines valid slots in ToggleButton component.
*/
export interface ToggleButtonSlots {}
export declare type ToggleButtonEmits = {
/**
* Defines valid emits in ToggleButton component.
*/
export interface ToggleButtonEmits {
/**
* Emitted when the value changes.
* @param {boolean} value - New value.
*/
'update:modelValue': (value: boolean) => void;
'update:modelValue'(value: boolean): void;
/**
* Callback to invoke on value change.
* @param {Event} event - Browser event.
*/
change: (event: Event) => void;
change(event: Event): void;
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
*/
focus: (event: Event) => void;
focus(event: Event): void;
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
*/
blur: (event: Event) => void;
};
blur(event: Event): void;
}
/**
* **PrimeVue - ToggleButton**
*
* _ToggleButton is used to select a boolean value using a button._
*
* [Live Demo](https://www.primevue.org/togglebutton/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
declare class ToggleButton extends ClassComponent<ToggleButtonProps, ToggleButtonSlots, ToggleButtonEmits> {}
declare module '@vue/runtime-core' {
@ -99,13 +128,4 @@ declare module '@vue/runtime-core' {
}
}
/**
*
* ToggleButton is used to select a boolean value using a button.
*
* Demos:
*
* - [ToggleButton](https://www.primefaces.org/primevue/togglebutton)
*
*/
export default ToggleButton;