2022-09-06 12:03:37 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
export interface InputMaskSlots {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
focus: (event: Event) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the component loses focus.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
blur: (event: Event) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a key is pressed.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
keydown: (event: Event) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a key that produces a character value is pressed down.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
keypress: (event: Event) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the user has initiated a 'paste' action through the browser's user interface.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
paste: (event: Event) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the mask is completed.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
complete: (event: Event) => void;
|
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class InputMask extends ClassComponent<InputMaskProps, InputMaskSlots, InputMaskEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
InputMask: GlobalComponentConstructor<InputMask>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.
|
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [InputMask](https://www.primefaces.org/primevue/inputmask)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default InputMask;
|