import { Component, EmitType } from '@syncfusion/ej2-base';
import { INotifyPropertyChanged } from '@syncfusion/ej2-base';
import { FloatLabelType } from '../input/input';
import { TextBoxModel } from './textbox-model';
export interface FocusInEventArgs {
/** Returns the TextBox container element */
container?: HTMLElement;
/** Returns the event parameters from TextBox. */
event?: Event;
/** Returns the entered value of the TextBox. */
value?: string;
}
export interface FocusOutEventArgs {
/** Returns the TextBox container element */
container?: HTMLElement;
/** Returns the event parameters from TextBox. */
event?: Event;
/** Returns the entered value of the TextBox. */
value?: string;
}
export interface ChangedEventArgs extends FocusInEventArgs {
/** Returns the previously entered value of the TextBox. */
previousValue?: string;
/** DEPRECATED-Returns the original event. */
isInteraction?: boolean;
/** Returns the original event. */
isInteracted?: boolean;
}
export interface InputEventArgs extends FocusInEventArgs {
/** Returns the previously updated value of the TextBox. */
previousValue?: string;
}
/**
* Represents the TextBox component that allows the user to enter the values based on it's type.
* ```html
*
* ```
* ```typescript
*
* ```
*/
export declare class TextBox extends Component implements INotifyPropertyChanged {
private textboxWrapper;
private l10n;
private previousValue;
private cloneElement;
private globalize;
private preventChange;
private isHiddenInput;
private textarea;
private respectiveElement;
private isForm;
private formElement;
private initialValue;
private textboxOptions;
private inputPreviousValue;
private clearButton;
private prependedElement;
private appendedElement;
private iconTemplateFunction;
/**
* Specifies the behavior of the TextBox such as text, password, email, etc.
*
* @default 'text'
*/
type: string;
/**
* Specifies the boolean value whether the TextBox allows user to change the text.
*
* @default false
*/
readonly: boolean;
/**
* Sets the content of the TextBox.
*
* @default null
*/
value: string;
/**
* Specifies the floating label behavior of the TextBox that the placeholder text floats above the TextBox based on the below values.
* Possible values are:
* * `Never` - The placeholder text should not be float ever.
* * `Always` - The placeholder text floats above the TextBox always.
* * `Auto` - The placeholder text floats above the TextBox while focusing or enter a value in Textbox.
*
* @default Never
*/
floatLabelType: FloatLabelType;
/**
* Specifies the CSS class value that is appended to wrapper of Textbox.
*
* @default ''
*/
cssClass: string;
/**
* Specifies the text that is shown as a hint/placeholder until the user focus or enter a value in Textbox.
* The property is depending on the floatLabelType property.
*
* @default null
*/
placeholder: string;
/**
* Specifies whether the browser is allow to automatically enter or select a value for the textbox.
* By default, autocomplete is enabled for textbox.
* Possible values are:
* `on` - Specifies that autocomplete is enabled.
* `off` - Specifies that autocomplete is disabled.
*
* @default 'on'
*/
autocomplete: string;
/**
* You can add the additional html attributes such as disabled, value etc., to the element.
* If you configured both property and equivalent html attribute then the component considers the property value.
* {% codeBlock src='textbox/htmlAttributes/index.md' %}{% endcodeBlock %}
*
* @default {}
*/
htmlAttributes: {
[key: string]: string;
};
/**
* Specifies a boolean value that enable or disable the multiline on the TextBox.
* The TextBox changes from single line to multiline when enable this multiline mode.
*
* @default false
*/
multiline: boolean;
/**
* Specifies a Boolean value that indicates whether the TextBox allow user to interact with it.
*
* @default true
*/
enabled: boolean;
/**
* Specifies a Boolean value that indicates whether the clear button is displayed in Textbox.
*
* @default false
*/
showClearButton: boolean;
/**
* Enable or disable persisting TextBox state between page reloads. If enabled, the `value` state will be persisted.
*
* @default false
*/
enablePersistence: boolean;
/**
* Specifies the width of the Textbox component.
*
* @default null
*/
width: number | string;
/**
* Specifies the HTML template string for custom elements to prepend to the TextBox input.
* Supports icons, buttons, or any valid HTML. Updates dynamically on property change.
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
prependTemplate: string | Function;
/**
* Specifies the HTML template string for custom elements to append to the TextBox input.
* Supports icons, buttons, or any valid HTML. Updates dynamically on property change.
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
appendTemplate: string | Function;
/**
* Triggers when the TextBox component is created.
*
* @event created
*/
created: EmitType