devextreme-react
Version:
DevExtreme React UI and Visualization Components
136 lines (134 loc) • 5.99 kB
TypeScript
/*!
* devextreme-react
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-react
*/
import * as React from "react";
import { Ref, ReactElement } from "react";
import dxTextBox, { Properties } from "devextreme/ui/text_box";
import { IHtmlOptions, NestedComponentMeta } from "./core/component";
import type { ChangeEvent, ContentReadyEvent, CopyEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, KeyDownEvent, KeyUpEvent, PasteEvent, ValueChangedEvent } from "devextreme/ui/text_box";
import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button";
import type { TextEditorButtonLocation, ButtonStyle, template, ButtonType } from "devextreme/common";
type ReplaceFieldTypes<TSource, TReplacement> = {
[P in keyof TSource]: P extends keyof TReplacement ? TReplacement[P] : TSource[P];
};
type ITextBoxOptionsNarrowedEvents = {
onChange?: ((e: ChangeEvent) => void);
onContentReady?: ((e: ContentReadyEvent) => void);
onCopy?: ((e: CopyEvent) => void);
onCut?: ((e: CutEvent) => void);
onDisposing?: ((e: DisposingEvent) => void);
onEnterKey?: ((e: EnterKeyEvent) => void);
onFocusIn?: ((e: FocusInEvent) => void);
onFocusOut?: ((e: FocusOutEvent) => void);
onInitialized?: ((e: InitializedEvent) => void);
onInput?: ((e: InputEvent) => void);
onKeyDown?: ((e: KeyDownEvent) => void);
onKeyUp?: ((e: KeyUpEvent) => void);
onPaste?: ((e: PasteEvent) => void);
onValueChanged?: ((e: ValueChangedEvent) => void);
};
type ITextBoxOptions = React.PropsWithChildren<ReplaceFieldTypes<Properties, ITextBoxOptionsNarrowedEvents> & IHtmlOptions & {
defaultValue?: string;
onValueChange?: (value: string) => void;
}>;
interface TextBoxRef {
instance: () => dxTextBox;
}
declare const TextBox: (props: React.PropsWithChildren<ITextBoxOptions> & {
ref?: Ref<TextBoxRef>;
}) => ReactElement | null;
type IButtonProps = React.PropsWithChildren<{
location?: TextEditorButtonLocation;
name?: string | undefined;
options?: dxButtonOptions | undefined;
}>;
declare const Button: ((props: IButtonProps) => React.FunctionComponentElement<React.PropsWithChildren<{
location?: TextEditorButtonLocation | undefined;
name?: string | undefined;
options?: dxButtonOptions | undefined;
} & {
children?: React.ReactNode;
} & {
elementDescriptor: import("./core/configuration/react/element").IElementDescriptor;
}>>) & NestedComponentMeta;
type IOptionsProps = React.PropsWithChildren<{
accessKey?: string | undefined;
activeStateEnabled?: boolean;
bindingOptions?: Record<string, any>;
disabled?: boolean;
elementAttr?: Record<string, any>;
focusStateEnabled?: boolean;
height?: (() => number | string) | number | string | undefined;
hint?: string | undefined;
hoverStateEnabled?: boolean;
icon?: string;
onClick?: ((e: ClickEvent) => void);
onContentReady?: ((e: ButtonContentReadyEvent) => void);
onDisposing?: ((e: ButtonDisposingEvent) => void);
onInitialized?: ((e: ButtonInitializedEvent) => void);
onOptionChanged?: ((e: OptionChangedEvent) => void);
rtlEnabled?: boolean;
stylingMode?: ButtonStyle;
tabIndex?: number;
template?: ((buttonData: {
icon: string;
text: string;
}, contentElement: any) => string | any) | template;
text?: string;
type?: ButtonType | string;
useSubmitBehavior?: boolean;
validationGroup?: string | undefined;
visible?: boolean;
width?: (() => number | string) | number | string | undefined;
render?: (...params: any) => React.ReactNode;
component?: React.ComponentType<any>;
}>;
declare const Options: ((props: IOptionsProps) => React.FunctionComponentElement<React.PropsWithChildren<{
accessKey?: string | undefined;
activeStateEnabled?: boolean | undefined;
bindingOptions?: Record<string, any> | undefined;
disabled?: boolean | undefined;
elementAttr?: Record<string, any> | undefined;
focusStateEnabled?: boolean | undefined;
height?: (() => number | string) | number | string | undefined;
hint?: string | undefined;
hoverStateEnabled?: boolean | undefined;
icon?: string | undefined;
onClick?: ((e: ClickEvent) => void) | undefined;
onContentReady?: ((e: ButtonContentReadyEvent) => void) | undefined;
onDisposing?: ((e: ButtonDisposingEvent) => void) | undefined;
onInitialized?: ((e: ButtonInitializedEvent) => void) | undefined;
onOptionChanged?: ((e: OptionChangedEvent) => void) | undefined;
rtlEnabled?: boolean | undefined;
stylingMode?: ButtonStyle | undefined;
tabIndex?: number | undefined;
template?: template | ((buttonData: {
icon: string;
text: string;
}, contentElement: any) => string | any) | undefined;
text?: string | undefined;
type?: string | undefined;
useSubmitBehavior?: boolean | undefined;
validationGroup?: string | undefined;
visible?: boolean | undefined;
width?: (() => number | string) | number | string | undefined;
render?: ((...params: any) => React.ReactNode) | undefined;
component?: React.ComponentType<any> | undefined;
} & {
children?: React.ReactNode;
} & {
elementDescriptor: import("./core/configuration/react/element").IElementDescriptor;
}>>) & NestedComponentMeta;
export default TextBox;
export { TextBox, ITextBoxOptions, TextBoxRef, Button, IButtonProps, Options, IOptionsProps };
import type * as TextBoxTypes from 'devextreme/ui/text_box_types';
export { TextBoxTypes };