devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
146 lines (120 loc) • 4.53 kB
TypeScript
/**
* DevExtreme (ui/text_box.d.ts)
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
EventInfo,
NativeEventInfo,
InitializedEventInfo,
ChangedOptionInfo,
} from '../common/core/events';
import {
ValueChangedInfo,
} from './editor/editor';
import dxTextEditor, {
dxTextEditorOptions,
} from './text_box/ui.text_editor.base';
export type TextBoxType = 'email' | 'password' | 'search' | 'tel' | 'text' | 'url';
/**
* The type of the change event handler's argument.
*/
export type ChangeEvent = NativeEventInfo<dxTextBox, Event>;
/**
* The type of the contentReady event handler's argument.
*/
export type ContentReadyEvent = EventInfo<dxTextBox>;
/**
* The type of the copy event handler's argument.
*/
export type CopyEvent = NativeEventInfo<dxTextBox, ClipboardEvent>;
/**
* The type of the cut event handler's argument.
*/
export type CutEvent = NativeEventInfo<dxTextBox, ClipboardEvent>;
/**
* The type of the disposing event handler's argument.
*/
export type DisposingEvent = EventInfo<dxTextBox>;
/**
* The type of the enterKey event handler's argument.
*/
export type EnterKeyEvent = NativeEventInfo<dxTextBox, KeyboardEvent>;
/**
* The type of the focusIn event handler's argument.
*/
export type FocusInEvent = NativeEventInfo<dxTextBox, FocusEvent>;
/**
* The type of the focusOut event handler's argument.
*/
export type FocusOutEvent = NativeEventInfo<dxTextBox, FocusEvent>;
/**
* The type of the initialized event handler's argument.
*/
export type InitializedEvent = InitializedEventInfo<dxTextBox>;
/**
* The type of the input event handler's argument.
*/
export type InputEvent = NativeEventInfo<dxTextBox, UIEvent & { target: HTMLInputElement }>;
/**
* The type of the keyDown event handler's argument.
*/
export type KeyDownEvent = NativeEventInfo<dxTextBox, KeyboardEvent>;
export type KeyPressEvent = NativeEventInfo<dxTextBox, KeyboardEvent>;
/**
* The type of the keyUp event handler's argument.
*/
export type KeyUpEvent = NativeEventInfo<dxTextBox, KeyboardEvent>;
/**
* The type of the optionChanged event handler's argument.
*/
export type OptionChangedEvent = EventInfo<dxTextBox> & ChangedOptionInfo;
/**
* The type of the paste event handler's argument.
*/
export type PasteEvent = NativeEventInfo<dxTextBox, ClipboardEvent>;
/**
* The type of the valueChanged event handler's argument.
*/
export type ValueChangedEvent = NativeEventInfo<dxTextBox, KeyboardEvent | MouseEvent | PointerEvent | TouchEvent | Event> & ValueChangedInfo;
/**
*
* @deprecated
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
*/
export interface dxTextBoxOptions<TComponent> extends dxTextEditorOptions<TComponent> {
/**
* Specifies the maximum number of characters you can enter into the textbox.
*/
maxLength?: string | number;
/**
* The 'mode' attribute value of the actual HTML input element representing the text box.
*/
mode?: TextBoxType;
/**
* Specifies a value the UI component displays.
*/
value?: string;
}
/**
* The TextBox is a UI component that enables a user to enter and edit a single line of text.
*/
export default class dxTextBox<TProperties = Properties> extends dxTextEditor<TProperties> {
/**
* Resets the value property to the value passed as an argument.
*/
reset(value?: string): void;
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
*/
interface TextBoxInstance extends dxTextBox<Properties> { }
export type Properties = dxTextBoxOptions<TextBoxInstance>;
/**
* @deprecated use Properties instead
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
*/
export type Options = Properties;