Fixed #1836 - For ToggleButton

pull/1846/head
mertsincan 2021-12-02 00:03:26 +03:00
parent 7832b3ac0b
commit 0fa4dd28ed
1 changed files with 64 additions and 11 deletions

View File

@ -1,16 +1,69 @@
interface ToggleButtonProps {
modelValue?: boolean;
onIcon?: string;
offIcon?: string;
onLabel?: string;
offLabel?: string;
iconPos?: string;
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type ToggleButtonType = 'left' | 'right';
export interface ToggleButtonProps {
/**
* Value of the component.
*/
modelValue?: boolean | undefined;
/**
* Icon for the on state.
*/
onIcon?: string | undefined;
/**
* Icon for the off state.
*/
offIcon?: string | undefined;
/**
* Label for the on state.
* Default value is 'yes'.
*/
onLabel?: string | undefined;
/**
* Label for the off state.
* Default value is 'no'.
*/
offLabel?: string | undefined;
/**
* Position of the icon.
* @see ToggleButtonType
* Default value is 'left'.
*/
iconPos?: ToggleButtonType;
}
declare class ToggleButton {
$props: ToggleButtonProps;
$emit(eventName: 'update:modelValue', value: boolean): this;
$emit(eventName: 'change', event: Event): this;
export interface ToggleButtonSlots {
}
export declare type ToggleButtonEmits = {
/**
* Emitted when the value changes.
* @param {boolean} value - New value.
*/
'update:modelValue': (value: boolean) => void;
/**
* Callback to invoke on value change.
* @param {Event} event - Browser event.
*/
'change': (event: Event) => void;
}
declare class ToggleButton extends ClassComponent<ToggleButtonProps, ToggleButtonSlots, ToggleButtonEmits> { }
declare module '@vue/runtime-core' {
interface GlobalComponents {
ToggleButton: GlobalComponentConstructor<ToggleButton>
}
}
/**
*
* ToggleButton is used to select a boolean value using a button.
*
* Demos:
*
* - [ToggleButton](https://www.primefaces.org/primevue/showcase/#/togglebutton)
*
*/
export default ToggleButton;