From ea6bd0fb3ac06cb54325b0d05117475f9e80f060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 26 Jul 2023 10:58:30 +0300 Subject: [PATCH] Refactor #4209 - For InputMask --- components/lib/inputmask/InputMask.d.ts | 30 ++++++++++++++++++++++++- components/lib/inputmask/InputMask.vue | 10 ++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/components/lib/inputmask/InputMask.d.ts b/components/lib/inputmask/InputMask.d.ts index 17933634d..d608e29bd 100755 --- a/components/lib/inputmask/InputMask.d.ts +++ b/components/lib/inputmask/InputMask.d.ts @@ -10,7 +10,16 @@ import { ComponentHooks } from '../basecomponent'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; -export declare type InputMaskPassThroughOptionType = InputMaskPassThroughAttributes | null | undefined; +export declare type InputMaskPassThroughOptionType = InputMaskPassThroughAttributes | ((options: InputMaskPassThroughMethodOptions) => InputMaskPassThroughAttributes | string) | string | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface InputMaskPassThroughMethodOptions { + instance: any; + props: InputMaskProps; + context: InputMaskContext; +} /** * Custom passthrough(pt) options. @@ -35,6 +44,22 @@ export interface InputMaskPassThroughAttributes { [key: string]: any; } +/** + * Defines current options in InputMask component. + */ +export interface InputMaskContext { + /** + * Current filled state of the component as a boolean. + * @defaultValue false + */ + filled: boolean; + /** + * Current disabled state of the component as a boolean. + * @defaultValue false + */ + disabled: boolean; +} + /** * Defines valid properties in InputMask component. */ @@ -79,6 +104,9 @@ export interface InputMaskProps { unstyled?: boolean; } +/** + * Defines valid slots in InputMask component. + */ export interface InputMaskSlots {} /** diff --git a/components/lib/inputmask/InputMask.vue b/components/lib/inputmask/InputMask.vue index 8080d745c..80e43c6e2 100755 --- a/components/lib/inputmask/InputMask.vue +++ b/components/lib/inputmask/InputMask.vue @@ -1,5 +1,5 @@