Fixed #1836 - For InputMask

pull/1846/head
mertsincan 2021-12-01 16:44:31 +03:00
parent c0ec5b9357
commit f4df7cfac6
1 changed files with 75 additions and 15 deletions

View File

@ -1,20 +1,80 @@
interface InputMaskProps {
modelValue?: string;
slotChar?: string;
mask?: string;
autoClear?: boolean;
unmask?: boolean;
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export interface InputMaskProps {
/**
* Value of the component.
*/
modelValue?: string | undefined;
/**
* Placeholder character in mask, default is underscore.
* Default value is '_'.
*/
slotChar?: string | undefined;
/**
* Mask pattern.
*/
mask?: string | undefined;
/**
* Clears the incomplete value on blur.
* Default value is true.
*/
autoClear?: boolean | undefined;
/**
* Defines if model sets the raw unmasked value to bound value or the formatted mask value.
*/
unmask?: boolean | undefined;
}
declare class InputMask {
$props: InputMaskProps;
$emit(eventName: 'update:modelValue', value: string): this;
$emit(eventName: 'focus', event: Event): this;
$emit(eventName: 'blur', event: Event): this;
$emit(eventName: 'keydown', event: Event): this;
$emit(eventName: 'keypress', event: Event): this;
$emit(eventName: 'paste', event: Event): this;
$emit(eventName: 'complete', event: Event): this;
export interface InputMaskSlots {
}
export declare type InputMaskEmits = {
/**
* Emitted when the value changes.
* @param {string} value - New value.
*/
'update:modelValue': (value: string) => void;
/**
* Callback to invoke when the component receives focus.
*/
'focus': (event: Event) => void;
/**
* Callback to invoke when the component loses focus.
*/
'blur': (event: Event) => void;
/**
* Callback to invoke when a key is pressed.
*/
'keydown': (event: Event) => void;
/**
* Callback to invoke when a key that produces a character value is pressed down.
*/
'keypress': (event: Event) => void;
/**
* Callback to invoke when the user has initiated a "paste" action through the browser's user interface.
*/
'paste': (event: Event) => void;
/**
* Callback to invoke when the mask is completed.
*/
'complete': (event: Event) => void;
}
declare class InputMask extends ClassComponent<InputMaskProps, InputMaskSlots, InputMaskEmits> { }
declare module '@vue/runtime-core' {
interface GlobalComponents {
InputMask: GlobalComponentConstructor<InputMask>
}
}
/**
*
* InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.
*
* Demos:
*
* - [InputMask](https://www.primefaces.org/primevue/showcase/#/inputmask)
*
*/
export default InputMask;