UNPKG

@rjsf/core

Version:

A simple React component capable of building HTML forms out of a JSON schema.

21 lines 1.07 kB
import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; /** * The NumberField class has some special handling for dealing with trailing * decimal points and/or zeroes. This logic is designed to allow trailing values * to be visible in the input element, but not be represented in the * corresponding form data. * * The algorithm is as follows: * * 1. When the input value changes the value is cached in the component state * * 2. The value is then normalized, removing trailing decimal points and zeros, * then passed to the "onChange" callback * * 3. When the component is rendered, the formData value is checked against the * value cached in the state. If it matches the cached value, the cached * value is passed to the input instead of the formData value */ declare function NumberField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element; export default NumberField; //# sourceMappingURL=NumberField.d.ts.map