2019-01-19 22:11:20 -06:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2019-2024 New Vector Ltd.
|
2019-01-19 22:11:20 -06:00
|
|
|
|
2024-09-09 14:57:16 +01:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2019-01-19 22:11:20 -06:00
|
|
|
*/
|
|
|
|
|
|
2024-05-28 14:55:47 +02:00
|
|
|
import React, {
|
|
|
|
|
InputHTMLAttributes,
|
|
|
|
|
SelectHTMLAttributes,
|
|
|
|
|
TextareaHTMLAttributes,
|
|
|
|
|
RefObject,
|
|
|
|
|
createRef,
|
2024-10-18 15:57:39 +01:00
|
|
|
ComponentProps,
|
2024-05-28 14:55:47 +02:00
|
|
|
} from "react";
|
2019-03-05 15:13:12 +00:00
|
|
|
import classNames from "classnames";
|
2021-06-29 13:11:58 +01:00
|
|
|
import { debounce } from "lodash";
|
2024-10-18 15:57:39 +01:00
|
|
|
import { Tooltip } from "@vector-im/compound-web";
|
2021-10-22 17:23:32 -05:00
|
|
|
|
2021-06-29 13:11:58 +01:00
|
|
|
import { IFieldState, IValidationResult } from "./Validation";
|
2019-04-23 17:59:19 +01:00
|
|
|
|
|
|
|
|
// Invoke validation from user input (when typing, etc.) at most once every N ms.
|
|
|
|
|
const VALIDATION_THROTTLE_MS = 200;
|
2019-01-19 22:11:20 -06:00
|
|
|
|
2020-03-29 22:59:15 +01:00
|
|
|
const BASE_ID = "mx_Field";
|
|
|
|
|
let count = 1;
|
2023-01-12 13:25:14 +00:00
|
|
|
function getId(): string {
|
2020-03-29 22:59:15 +01:00
|
|
|
return `${BASE_ID}_${count++}`;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-07 08:54:41 +01:00
|
|
|
export interface IValidateOpts {
|
|
|
|
|
focused?: boolean;
|
|
|
|
|
allowEmpty?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-17 02:14:20 +01:00
|
|
|
interface IProps {
|
2020-05-25 13:40:05 +01:00
|
|
|
// The field's ID, which binds the input and label together. Immutable.
|
2020-06-17 02:14:20 +01:00
|
|
|
id?: string;
|
2020-05-25 13:40:05 +01:00
|
|
|
// The field's label string.
|
2020-06-17 02:14:20 +01:00
|
|
|
label?: string;
|
2020-05-25 13:40:05 +01:00
|
|
|
// The field's placeholder string. Defaults to the label.
|
2020-06-17 02:14:20 +01:00
|
|
|
placeholder?: string;
|
2021-11-01 23:44:42 -06:00
|
|
|
// When true (default false), the placeholder will be shown instead of the label when
|
|
|
|
|
// the component is unfocused & empty.
|
|
|
|
|
usePlaceholderAsHint?: boolean;
|
2020-05-25 13:40:05 +01:00
|
|
|
// Optional component to include inside the field before the input.
|
2020-06-17 02:14:20 +01:00
|
|
|
prefixComponent?: React.ReactNode;
|
2020-05-25 13:40:05 +01:00
|
|
|
// Optional component to include inside the field after the input.
|
2020-06-17 02:14:20 +01:00
|
|
|
postfixComponent?: React.ReactNode;
|
2020-05-25 13:40:05 +01:00
|
|
|
// The callback called whenever the contents of the field
|
|
|
|
|
// changes. Returns an object with `valid` boolean field
|
|
|
|
|
// and a `feedback` react component field to provide feedback
|
|
|
|
|
// to the user.
|
2020-06-17 02:14:20 +01:00
|
|
|
onValidate?: (input: IFieldState) => Promise<IValidationResult>;
|
2020-05-25 13:40:05 +01:00
|
|
|
// If specified, overrides the value returned by onValidate.
|
2020-06-26 18:50:05 +01:00
|
|
|
forceValidity?: boolean;
|
2020-05-25 13:40:05 +01:00
|
|
|
// If specified, contents will appear as a tooltip on the element and
|
|
|
|
|
// validation feedback tooltips will be suppressed.
|
2024-10-18 15:57:39 +01:00
|
|
|
tooltipContent?: JSX.Element | string;
|
2020-06-15 17:42:30 +01:00
|
|
|
// If specified the tooltip will be shown regardless of feedback
|
2020-06-22 11:39:11 +01:00
|
|
|
forceTooltipVisible?: boolean;
|
2024-09-20 12:24:39 +01:00
|
|
|
// If specified, the tooltip with be aligned accorindly with the field, defaults to Right.
|
2024-10-18 15:57:39 +01:00
|
|
|
tooltipAlignment?: ComponentProps<typeof Tooltip>["placement"];
|
2020-05-25 13:40:05 +01:00
|
|
|
// If specified alongside tooltipContent, the class name to apply to the
|
|
|
|
|
// tooltip itself.
|
2020-06-17 02:14:20 +01:00
|
|
|
tooltipClassName?: string;
|
2020-05-25 13:40:05 +01:00
|
|
|
// If specified, an additional class name to apply to the field container
|
2020-06-17 02:14:20 +01:00
|
|
|
className?: string;
|
2020-11-25 09:19:08 +00:00
|
|
|
// On what events should validation occur; by default on all
|
|
|
|
|
validateOnFocus?: boolean;
|
|
|
|
|
validateOnBlur?: boolean;
|
|
|
|
|
validateOnChange?: boolean;
|
2020-05-25 13:40:05 +01:00
|
|
|
// All other props pass through to the <input>.
|
|
|
|
|
}
|
2019-01-22 13:09:40 -07:00
|
|
|
|
2024-11-13 00:36:08 +05:30
|
|
|
type RefCallback<T extends HTMLElement> = (node: T | null) => void;
|
|
|
|
|
|
2020-11-19 15:10:40 +00:00
|
|
|
export interface IInputProps extends IProps, InputHTMLAttributes<HTMLInputElement> {
|
2022-01-27 16:32:12 -06:00
|
|
|
// The ref pass through to the input
|
|
|
|
|
inputRef?: RefObject<HTMLInputElement>;
|
2024-11-13 00:36:08 +05:30
|
|
|
// Ref callback that will be attached to the input. This takes precedence over inputRef.
|
|
|
|
|
refCallback?: RefCallback<HTMLInputElement>;
|
2020-06-17 02:14:20 +01:00
|
|
|
// The element to create. Defaults to "input".
|
2023-03-13 15:07:20 +00:00
|
|
|
element: "input";
|
2020-06-17 02:14:20 +01:00
|
|
|
// The input's value. This is a controlled component, so the value is required.
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ISelectProps extends IProps, SelectHTMLAttributes<HTMLSelectElement> {
|
2022-01-27 16:32:12 -06:00
|
|
|
// The ref pass through to the select
|
|
|
|
|
inputRef?: RefObject<HTMLSelectElement>;
|
2024-11-13 00:36:08 +05:30
|
|
|
// Ref callback that will be attached to the input. This takes precedence over inputRef.
|
|
|
|
|
refCallback?: RefCallback<HTMLSelectElement>;
|
2020-06-17 02:14:20 +01:00
|
|
|
// To define options for a select, use <Field><option ... /></Field>
|
|
|
|
|
element: "select";
|
|
|
|
|
// The select's value. This is a controlled component, so the value is required.
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ITextareaProps extends IProps, TextareaHTMLAttributes<HTMLTextAreaElement> {
|
2022-01-27 16:32:12 -06:00
|
|
|
// The ref pass through to the textarea
|
|
|
|
|
inputRef?: RefObject<HTMLTextAreaElement>;
|
2024-11-13 00:36:08 +05:30
|
|
|
// Ref callback that will be attached to the input. This takes precedence over inputRef.
|
|
|
|
|
refCallback?: RefCallback<HTMLTextAreaElement>;
|
2020-06-17 02:14:20 +01:00
|
|
|
element: "textarea";
|
|
|
|
|
// The textarea's value. This is a controlled component, so the value is required.
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-27 16:32:12 -06:00
|
|
|
export interface INativeOnChangeInputProps extends IProps, InputHTMLAttributes<HTMLInputElement> {
|
|
|
|
|
// The ref pass through to the input
|
|
|
|
|
inputRef?: RefObject<HTMLInputElement>;
|
2024-11-13 00:36:08 +05:30
|
|
|
// Ref callback that will be attached to the input. This takes precedence over inputRef.
|
|
|
|
|
refCallback?: RefCallback<HTMLInputElement>;
|
2022-01-27 16:32:12 -06:00
|
|
|
element: "input";
|
|
|
|
|
// The input's value. This is a controlled component, so the value is required.
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PropShapes = IInputProps | ISelectProps | ITextareaProps | INativeOnChangeInputProps;
|
2020-06-17 02:14:20 +01:00
|
|
|
|
2020-05-25 13:40:05 +01:00
|
|
|
interface IState {
|
2023-02-16 09:38:44 +00:00
|
|
|
valid?: boolean;
|
2024-10-18 15:57:39 +01:00
|
|
|
feedback?: JSX.Element | string;
|
2020-06-18 14:32:43 +01:00
|
|
|
feedbackVisible: boolean;
|
|
|
|
|
focused: boolean;
|
2020-05-25 13:40:05 +01:00
|
|
|
}
|
|
|
|
|
|
2020-06-17 02:14:20 +01:00
|
|
|
export default class Field extends React.PureComponent<PropShapes, IState> {
|
2023-03-29 08:23:54 +01:00
|
|
|
private readonly id: string;
|
2023-05-16 14:25:43 +01:00
|
|
|
private readonly _inputRef = createRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>();
|
2020-05-25 13:40:05 +01:00
|
|
|
|
2020-06-18 14:32:43 +01:00
|
|
|
public static readonly defaultProps = {
|
2020-05-25 16:47:57 +01:00
|
|
|
element: "input",
|
|
|
|
|
type: "text",
|
2020-11-25 09:19:08 +00:00
|
|
|
validateOnFocus: true,
|
|
|
|
|
validateOnBlur: true,
|
|
|
|
|
validateOnChange: true,
|
2024-10-18 15:57:39 +01:00
|
|
|
tooltipAlignment: "right",
|
2020-06-18 14:32:43 +01:00
|
|
|
};
|
2020-05-25 16:47:57 +01:00
|
|
|
|
2020-05-25 13:40:05 +01:00
|
|
|
/*
|
|
|
|
|
* This was changed from throttle to debounce: this is more traditional for
|
|
|
|
|
* form validation since it means that the validation doesn't happen at all
|
|
|
|
|
* until the user stops typing for a bit (debounce defaults to not running on
|
|
|
|
|
* the leading edge). If we're doing an HTTP hit on each validation, we have more
|
|
|
|
|
* incentive to prevent validating input that's very unlikely to be valid.
|
|
|
|
|
* We may find that we actually want different behaviour for registration
|
|
|
|
|
* fields, in which case we can add some options to control it.
|
|
|
|
|
*/
|
2020-05-26 12:09:23 +01:00
|
|
|
private validateOnChange = debounce(() => {
|
2020-05-25 13:40:05 +01:00
|
|
|
this.validate({
|
|
|
|
|
focused: true,
|
|
|
|
|
});
|
|
|
|
|
}, VALIDATION_THROTTLE_MS);
|
|
|
|
|
|
2023-02-13 11:39:16 +00:00
|
|
|
public constructor(props: PropShapes) {
|
2020-03-29 23:16:57 +01:00
|
|
|
super(props);
|
2019-02-01 00:36:19 +01:00
|
|
|
this.state = {
|
2020-05-25 13:40:05 +01:00
|
|
|
feedbackVisible: false,
|
2019-12-17 14:28:18 +00:00
|
|
|
focused: false,
|
2019-02-01 00:36:19 +01:00
|
|
|
};
|
2020-03-29 22:59:15 +01:00
|
|
|
|
|
|
|
|
this.id = this.props.id || getId();
|
2019-02-01 00:36:19 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-12 13:25:14 +00:00
|
|
|
public focus(): void {
|
2022-01-27 16:32:12 -06:00
|
|
|
this.inputRef.current?.focus();
|
2021-10-08 14:33:58 +01:00
|
|
|
// programmatic does not fire onFocus handler
|
|
|
|
|
this.setState({
|
|
|
|
|
focused: true,
|
|
|
|
|
});
|
2020-05-26 12:09:23 +01:00
|
|
|
}
|
|
|
|
|
|
2023-02-13 11:39:16 +00:00
|
|
|
private onFocus = (ev: React.FocusEvent<any>): void => {
|
2019-12-17 14:28:18 +00:00
|
|
|
this.setState({
|
|
|
|
|
focused: true,
|
|
|
|
|
});
|
2020-11-25 09:19:08 +00:00
|
|
|
if (this.props.validateOnFocus) {
|
|
|
|
|
this.validate({
|
|
|
|
|
focused: true,
|
|
|
|
|
});
|
|
|
|
|
}
|
2019-04-16 18:12:13 +01:00
|
|
|
// Parent component may have supplied its own `onFocus` as well
|
2023-02-13 11:39:16 +00:00
|
|
|
this.props.onFocus?.(ev);
|
2019-04-16 18:12:13 +01:00
|
|
|
};
|
|
|
|
|
|
2023-02-13 11:39:16 +00:00
|
|
|
private onChange = (ev: React.ChangeEvent<any>): void => {
|
2020-11-25 09:19:08 +00:00
|
|
|
if (this.props.validateOnChange) {
|
|
|
|
|
this.validateOnChange();
|
|
|
|
|
}
|
2019-03-07 14:45:18 +00:00
|
|
|
// Parent component may have supplied its own `onChange` as well
|
2023-02-13 11:39:16 +00:00
|
|
|
this.props.onChange?.(ev);
|
2019-02-01 00:36:19 +01:00
|
|
|
};
|
|
|
|
|
|
2023-02-13 11:39:16 +00:00
|
|
|
private onBlur = (ev: React.FocusEvent<any>): void => {
|
2019-12-17 14:28:18 +00:00
|
|
|
this.setState({
|
|
|
|
|
focused: false,
|
|
|
|
|
});
|
2020-11-25 09:19:08 +00:00
|
|
|
if (this.props.validateOnBlur) {
|
|
|
|
|
this.validate({
|
|
|
|
|
focused: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
2019-04-16 18:12:13 +01:00
|
|
|
// Parent component may have supplied its own `onBlur` as well
|
2023-02-13 11:39:16 +00:00
|
|
|
this.props.onBlur?.(ev);
|
2019-04-16 18:12:13 +01:00
|
|
|
};
|
|
|
|
|
|
2023-02-16 09:38:44 +00:00
|
|
|
public async validate({ focused, allowEmpty = true }: IValidateOpts): Promise<boolean | undefined> {
|
2019-04-16 18:12:13 +01:00
|
|
|
if (!this.props.onValidate) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-01-27 16:32:12 -06:00
|
|
|
const value = this.inputRef.current?.value ?? null;
|
2019-04-23 14:55:57 +01:00
|
|
|
const { valid, feedback } = await this.props.onValidate({
|
2019-04-16 18:12:13 +01:00
|
|
|
value,
|
2023-03-13 15:07:20 +00:00
|
|
|
focused: !!focused,
|
2019-04-18 21:33:37 +01:00
|
|
|
allowEmpty,
|
2019-04-16 18:12:13 +01:00
|
|
|
});
|
2019-04-25 11:10:35 +01:00
|
|
|
|
2019-12-17 14:36:20 +00:00
|
|
|
// this method is async and so we may have been blurred since the method was called
|
|
|
|
|
// if we have then hide the feedback as withValidation does
|
2019-12-17 14:28:18 +00:00
|
|
|
if (this.state.focused && feedback) {
|
2019-04-25 11:10:35 +01:00
|
|
|
this.setState({
|
|
|
|
|
valid,
|
|
|
|
|
feedback,
|
|
|
|
|
feedbackVisible: true,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// When we receive null `feedback`, we want to hide the tooltip.
|
|
|
|
|
// We leave the previous `feedback` content in state without updating it,
|
|
|
|
|
// so that we can hide the tooltip containing the most recent feedback
|
|
|
|
|
// via CSS animation.
|
|
|
|
|
this.setState({
|
|
|
|
|
valid,
|
|
|
|
|
feedbackVisible: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-11-23 10:25:46 +00:00
|
|
|
|
|
|
|
|
return valid;
|
2019-04-16 18:12:13 +01:00
|
|
|
}
|
|
|
|
|
|
2023-05-16 14:25:43 +01:00
|
|
|
private get inputRef(): RefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement> {
|
|
|
|
|
return this.props.inputRef ?? this._inputRef;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-18 15:57:39 +01:00
|
|
|
private onTooltipOpenChange = (open: boolean): void => {
|
|
|
|
|
this.setState({
|
|
|
|
|
feedbackVisible: open,
|
|
|
|
|
});
|
2024-05-28 14:55:47 +02:00
|
|
|
};
|
|
|
|
|
|
2023-02-13 17:01:43 +00:00
|
|
|
public render(): React.ReactNode {
|
2020-08-29 01:11:08 +01:00
|
|
|
/* eslint @typescript-eslint/no-unused-vars: ["error", { "ignoreRestSiblings": true }] */
|
2022-05-10 12:49:05 -04:00
|
|
|
const {
|
|
|
|
|
element,
|
|
|
|
|
inputRef,
|
|
|
|
|
prefixComponent,
|
|
|
|
|
postfixComponent,
|
|
|
|
|
className,
|
|
|
|
|
onValidate,
|
|
|
|
|
children,
|
2020-12-03 12:20:48 +00:00
|
|
|
tooltipContent,
|
|
|
|
|
forceValidity,
|
|
|
|
|
tooltipClassName,
|
|
|
|
|
validateOnBlur,
|
|
|
|
|
validateOnChange,
|
|
|
|
|
validateOnFocus,
|
2021-12-15 16:27:02 +00:00
|
|
|
usePlaceholderAsHint,
|
|
|
|
|
forceTooltipVisible,
|
2024-09-20 12:24:39 +01:00
|
|
|
tooltipAlignment,
|
2021-06-29 13:11:58 +01:00
|
|
|
...inputProps
|
|
|
|
|
} = this.props;
|
2019-01-19 22:11:20 -06:00
|
|
|
|
2023-04-14 15:15:26 +01:00
|
|
|
// Handle displaying feedback on validity
|
2024-10-18 15:57:39 +01:00
|
|
|
const tooltipProps: Pick<React.ComponentProps<typeof Tooltip>, "aria-live" | "aria-atomic"> = {};
|
|
|
|
|
let tooltipOpen = false;
|
2023-04-14 15:15:26 +01:00
|
|
|
if (tooltipContent || this.state.feedback) {
|
2024-10-18 15:57:39 +01:00
|
|
|
tooltipOpen = (this.state.focused && forceTooltipVisible) || this.state.feedbackVisible;
|
2023-04-14 15:15:26 +01:00
|
|
|
|
2024-10-18 15:57:39 +01:00
|
|
|
if (!tooltipContent) {
|
|
|
|
|
tooltipProps["aria-atomic"] = "true";
|
|
|
|
|
tooltipProps["aria-live"] = this.state.valid ? "polite" : "assertive";
|
2023-04-14 15:15:26 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-11 11:10:55 +01:00
|
|
|
inputProps.placeholder = inputProps.placeholder ?? inputProps.label;
|
2020-03-29 22:59:15 +01:00
|
|
|
inputProps.id = this.id; // this overwrites the id from props
|
2019-01-22 19:25:09 -07:00
|
|
|
|
2019-04-16 18:12:13 +01:00
|
|
|
inputProps.onFocus = this.onFocus;
|
2019-02-01 00:36:19 +01:00
|
|
|
inputProps.onChange = this.onChange;
|
2019-04-16 18:12:13 +01:00
|
|
|
inputProps.onBlur = this.onBlur;
|
2019-03-12 16:17:21 +00:00
|
|
|
|
2020-05-25 13:40:05 +01:00
|
|
|
// Appease typescript's inference
|
2023-03-29 08:23:54 +01:00
|
|
|
const inputProps_: React.HTMLAttributes<HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement> &
|
|
|
|
|
React.ClassAttributes<HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement> = {
|
|
|
|
|
...inputProps,
|
2024-11-13 00:36:08 +05:30
|
|
|
ref: this.props.refCallback ?? this.inputRef,
|
2023-03-29 08:23:54 +01:00
|
|
|
};
|
2020-05-25 13:40:05 +01:00
|
|
|
|
2022-05-10 12:49:05 -04:00
|
|
|
const fieldInput = React.createElement(this.props.element, inputProps_, children);
|
2019-01-19 22:11:20 -06:00
|
|
|
|
2023-02-16 09:38:44 +00:00
|
|
|
let prefixContainer: JSX.Element | undefined;
|
2020-05-25 13:40:05 +01:00
|
|
|
if (prefixComponent) {
|
2021-07-19 22:43:11 +01:00
|
|
|
prefixContainer = <span className="mx_Field_prefix">{prefixComponent}</span>;
|
2019-03-05 15:13:12 +00:00
|
|
|
}
|
2023-02-16 09:38:44 +00:00
|
|
|
let postfixContainer: JSX.Element | undefined;
|
2020-05-25 13:40:05 +01:00
|
|
|
if (postfixComponent) {
|
2021-07-19 22:43:11 +01:00
|
|
|
postfixContainer = <span className="mx_Field_postfix">{postfixComponent}</span>;
|
2019-09-20 17:45:14 +02:00
|
|
|
}
|
2019-03-05 15:13:12 +00:00
|
|
|
|
2020-06-26 18:50:05 +01:00
|
|
|
const hasValidationFlag = forceValidity !== null && forceValidity !== undefined;
|
2022-01-27 16:32:12 -06:00
|
|
|
const fieldClasses = classNames("mx_Field", `mx_Field_${this.props.element}`, className, {
|
|
|
|
|
// If we have a prefix element, leave the label always at the top left and
|
|
|
|
|
// don't animate it, as it looks a bit clunky and would add complexity to do
|
|
|
|
|
// properly.
|
|
|
|
|
mx_Field_labelAlwaysTopLeft: prefixComponent || usePlaceholderAsHint,
|
|
|
|
|
mx_Field_placeholderIsHint: usePlaceholderAsHint,
|
|
|
|
|
mx_Field_valid: hasValidationFlag ? forceValidity : onValidate && this.state.valid === true,
|
|
|
|
|
mx_Field_invalid: hasValidationFlag ? !forceValidity : onValidate && this.state.valid === false,
|
|
|
|
|
});
|
2019-03-05 15:13:12 +00:00
|
|
|
|
2019-02-01 00:36:19 +01:00
|
|
|
return (
|
2024-10-18 15:57:39 +01:00
|
|
|
<div className={fieldClasses}>
|
2021-07-19 22:43:11 +01:00
|
|
|
{prefixContainer}
|
2024-10-18 15:57:39 +01:00
|
|
|
<Tooltip
|
|
|
|
|
{...tooltipProps}
|
|
|
|
|
placement={tooltipAlignment}
|
|
|
|
|
description=""
|
|
|
|
|
caption={tooltipContent || this.state.feedback}
|
|
|
|
|
open={tooltipOpen}
|
|
|
|
|
onOpenChange={this.onTooltipOpenChange}
|
|
|
|
|
>
|
|
|
|
|
{fieldInput}
|
|
|
|
|
</Tooltip>
|
2021-07-19 22:43:11 +01:00
|
|
|
<label htmlFor={this.id}>{this.props.label}</label>
|
|
|
|
|
{postfixContainer}
|
2019-01-19 22:11:20 -06:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|