Fixed #1836 - For Checkbox

pull/1846/head
mertsincan 2021-12-01 15:36:13 +03:00
parent 2a62d2696a
commit 947d902c1b
1 changed files with 65 additions and 7 deletions

View File

@ -1,19 +1,77 @@
interface CheckboxProps { import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export interface CheckboxProps {
/**
* Value of the checkbox.
*/
value?: any; value?: any;
/**
* Value binding of the checkbox.
*/
modelValue?: any; modelValue?: any;
/**
* Allows to select a boolean value instead of multiple values.
*/
binary?: boolean; binary?: boolean;
/**
* Style class of the component input field.
*/
class?: string; class?: string;
/**
* Inline style of the component.
*/
style?: any; style?: any;
/**
* Value in checked state.
*/
trueValue?: any; trueValue?: any;
/**
* Value in unchecked state.
*/
falseValue?: any; falseValue?: any;
} }
declare class Checkbox { export interface CheckboxSlots {
$props: CheckboxProps;
$emit(eventName: 'update:page', value: any): this;
$emit(eventName: 'click', event: Event): this;
$emit(eventName: 'change', event: Event): this;
$emit(eventName: 'input', value: boolean): this;
} }
export declare type CheckboxEmits = {
/**
* Emitted when the page changes.
* @param {*} value - New page value.
*/
'update:page': (value: any) => void;
/**
* Callback to invoke on value click.
* @param {MouseEvent} event - Browser event.
*/
'click': (event: MouseEvent) => void;
/**
* Callback to invoke on value change.
* @param {Event} event - Browser event.
*/
'change': (event: Event) => void;
/**
* Callback to invoke on value change.
* @param {boolean} value - New value.
*/
'input': (value: boolean) => void;
}
declare class Checkbox extends ClassComponent<CheckboxProps, CheckboxSlots, CheckboxEmits> { }
declare module '@vue/runtime-core' {
interface GlobalComponents {
Checkbox: GlobalComponentConstructor<Checkbox>
}
}
/**
*
* Checkbox is an extension to standard checkbox element with theming.
*
* Demos:
*
* - [Checkbox](https://www.primefaces.org/primevue/showcase/#/checkbox)
*
*/
export default Checkbox; export default Checkbox;