Fixed #1836 - For ToggleButton
parent
7832b3ac0b
commit
0fa4dd28ed
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue