@iobroker/adapter-react
Version:
React classes to develop admin interfaces for ioBroker with react.
93 lines (92 loc) • 3.01 kB
TypeScript
export default _export;
export type TextInputProps = {
/**
* The key to identify this component.
*/
key?: string;
/**
* The dialog close callback.
*/
onClose: (text: string | null) => void;
/**
* The title text.
*/
titleText: string;
/**
* Prompt text (default: empty).
*/
promptText?: string;
/**
* Label text (default: empty).
*/
labelText?: string;
/**
* The text of the cancel button.
*/
cancelText: string;
/**
* The text of the apply button.
*/
applyText: string;
/**
* The verification callback. Return a non-empty string if there was an error.
*/
verify?: (text: string) => string;
/**
* The text replacement callback.
*/
rule?: (text: string) => string;
/**
* The type of the textbox (default: text).
*/
type?: 'text' | 'number' | 'password' | 'email';
/**
* The input when opening the dialog.
*/
input?: string;
};
/** @type {typeof TextInput} */
declare const _export: typeof TextInput;
/**
* @typedef {object} TextInputProps
* @property {string} [key] The key to identify this component.
* @property {(text: string | null) => void} onClose The dialog close callback.
* @property {string} titleText The title text.
* @property {string} [promptText] Prompt text (default: empty).
* @property {string} [labelText] Label text (default: empty).
* @property {string} cancelText The text of the cancel button.
* @property {string} applyText The text of the apply button.
* @property {(text: string) => string} [verify] The verification callback. Return a non-empty string if there was an error.
* @property {(text: string) => string} [rule] The text replacement callback.
* @property {'text' | 'number' | 'password' | 'email'} [type] The type of the textbox (default: text).
* @property {string} [input] The input when opening the dialog.
*
* @extends {React.Component<TextInputProps>}
*/
declare class TextInput extends React.Component<TextInputProps, any, any> {
/**
* @param {Readonly<TextInputProps>} props
*/
constructor(props: Readonly<TextInputProps>);
state: {
text: any;
error: string;
};
render(): JSX.Element;
}
declare namespace TextInput {
namespace propTypes {
const onClose: PropTypes.Validator<(...args: any[]) => any>;
const titleText: PropTypes.Validator<string>;
const promptText: PropTypes.Requireable<string>;
const labelText: PropTypes.Requireable<string>;
const cancelText: PropTypes.Requireable<string>;
const applyText: PropTypes.Requireable<string>;
const verify: PropTypes.Requireable<(...args: any[]) => any>;
const replace: PropTypes.Requireable<(...args: any[]) => any>;
const type: PropTypes.Requireable<string>;
const value: PropTypes.Requireable<string>;
}
}
import React from "react";
import PropTypes from "prop-types";