mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Refactor #4124 - InputText pt context improvements
This commit is contained in:
parent
02f67d1b0f
commit
e1c7806c2d
2 changed files with 28 additions and 2 deletions
27
components/lib/inputtext/InputText.d.ts
vendored
27
components/lib/inputtext/InputText.d.ts
vendored
|
@ -11,7 +11,16 @@ import { InputHTMLAttributes } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { ClassComponent, GlobalComponentConstructor, Nullable } from '../ts-helpers';
|
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.
|
* Custom passthrough(pt) options.
|
||||||
|
@ -36,6 +45,22 @@ export interface InputTextPassThroughAttributes {
|
||||||
[key: string]: any;
|
[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.
|
* Defines valid properties in InputText component.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,7 +21,8 @@ export default {
|
||||||
ptmParams() {
|
ptmParams() {
|
||||||
return {
|
return {
|
||||||
context: {
|
context: {
|
||||||
filled: this.filled
|
filled: this.filled,
|
||||||
|
disabled: this.$attrs.disabled || this.$attrs.disabled === ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue