Refactor #4124 - InputText pt context improvements
parent
02f67d1b0f
commit
e1c7806c2d
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -21,7 +21,8 @@ export default {
|
|||
ptmParams() {
|
||||
return {
|
||||
context: {
|
||||
filled: this.filled
|
||||
filled: this.filled,
|
||||
disabled: this.$attrs.disabled || this.$attrs.disabled === ''
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue