143 lines
3.4 KiB
TypeScript
Executable File
143 lines
3.4 KiB
TypeScript
Executable File
/**
|
|
*
|
|
* InputText renders a text field to enter data.
|
|
*
|
|
* [Live Demo](https://www.primevue.org/inputtext/)
|
|
*
|
|
* @module inputtext
|
|
*
|
|
*/
|
|
import { InputHTMLAttributes } from 'vue';
|
|
import { ComponentHooks } from '../basecomponent';
|
|
import { PassThroughOptions } from '../passthrough';
|
|
import { ClassComponent, GlobalComponentConstructor, Nullable, PassThrough } from '../ts-helpers';
|
|
|
|
export declare type InputTextPassThroughOptionType = InputTextPassThroughAttributes | ((options: InputTextPassThroughMethodOptions) => InputTextPassThroughAttributes | string) | string | null | undefined;
|
|
|
|
/**
|
|
* Custom passthrough(pt) option method.
|
|
*/
|
|
export interface InputTextPassThroughMethodOptions {
|
|
/**
|
|
* Defines instance.
|
|
*/
|
|
instance: any;
|
|
/**
|
|
* Defines valid properties.
|
|
*/
|
|
props: InputTextProps;
|
|
/**
|
|
* Defines current options.
|
|
*/
|
|
context: InputTextContext;
|
|
/**
|
|
* Defines passthrough(pt) options in global config.
|
|
*/
|
|
global: object | undefined;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough(pt) options.
|
|
* @see {@link InputTextProps.pt}
|
|
*/
|
|
export interface InputTextPassThroughOptions {
|
|
/**
|
|
* Used to pass attributes to the root's DOM element.
|
|
*/
|
|
root?: InputTextPassThroughOptionType;
|
|
/**
|
|
* Used to manage all lifecycle hooks
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
*/
|
|
hooks?: ComponentHooks;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough attributes for each DOM elements
|
|
*/
|
|
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.
|
|
*/
|
|
export interface InputTextProps extends InputHTMLAttributes {
|
|
/**
|
|
* Value of the component.
|
|
*/
|
|
modelValue?: Nullable<string>;
|
|
/**
|
|
* Defines the size of the component.
|
|
*/
|
|
size?: 'small' | 'large' | undefined;
|
|
/**
|
|
* Used to pass attributes to DOM elements inside the component.
|
|
* @type {InputTextPassThroughOptions}
|
|
*/
|
|
pt?: PassThrough<InputTextPassThroughOptions>;
|
|
/**
|
|
* Used to configure passthrough(pt) options of the component.
|
|
* @type {PassThroughOptions}
|
|
*/
|
|
ptOptions?: PassThroughOptions;
|
|
/**
|
|
* When enabled, it removes component related styles in the core.
|
|
* @defaultValue false
|
|
*/
|
|
unstyled?: boolean;
|
|
}
|
|
|
|
/**
|
|
* Defines valid slots in InputText component.
|
|
*/
|
|
export interface InputTextSlots {}
|
|
|
|
/**
|
|
* Defines valid emits in InputText component.
|
|
*/
|
|
export interface InputTextEmits {
|
|
/**
|
|
* Emitted when the value changes.
|
|
* @param {string} value - New value.
|
|
*/
|
|
'update:modelValue'(value: string | undefined): void;
|
|
}
|
|
|
|
/**
|
|
* **PrimeVue - InputText**
|
|
*
|
|
* _InputText renders a text field to enter data._
|
|
*
|
|
* [Live Demo](https://www.primevue.org/inputtext/)
|
|
* --- ---
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
*
|
|
* @group Component
|
|
*/
|
|
declare class InputText extends ClassComponent<InputTextProps, InputTextSlots, InputTextEmits> {}
|
|
|
|
declare module '@vue/runtime-core' {
|
|
interface GlobalComponents {
|
|
InputText: GlobalComponentConstructor<InputText>;
|
|
}
|
|
}
|
|
|
|
export default InputText;
|