diff --git a/components/lib/inputtext/InputText.d.ts b/components/lib/inputtext/InputText.d.ts index f57e418c8..616db110e 100755 --- a/components/lib/inputtext/InputText.d.ts +++ b/components/lib/inputtext/InputText.d.ts @@ -11,7 +11,16 @@ import { InputHTMLAttributes } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { ClassComponent, GlobalComponentConstructor, Nullable } from '../ts-helpers'; -export declare type InputTextPassThroughOptionType = InputTextPassThroughAttributes | null | undefined; +export declare type InputTextPassThroughOptionType = InputTextPassThroughAttributes | ((options: InputTextPassThroughMethodOptions) => InputTextPassThroughAttributes | string) | string | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface InputTextPassThroughMethodOptions { + instance: any; + props: InputTextProps; + context: InputTextContext; +} /** * Custom passthrough(pt) options. @@ -36,6 +45,22 @@ export interface InputTextPassThroughAttributes { [key: string]: any; } +/** + * Defines current options in InputText component. + */ +export interface InputTextContext { + /** + * 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 InputText component. */ diff --git a/components/lib/inputtext/InputText.vue b/components/lib/inputtext/InputText.vue index 33eea8556..1f2077a9d 100755 --- a/components/lib/inputtext/InputText.vue +++ b/components/lib/inputtext/InputText.vue @@ -21,7 +21,8 @@ export default { ptmParams() { return { context: { - filled: this.filled + filled: this.filled, + disabled: this.$attrs.disabled || this.$attrs.disabled === '' } }; }