UNPKG

extended-dynamic-forms

Version:

Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events

40 lines (38 loc) 980 B
import { FC } from 'react'; import { WidgetProps } from '@rjsf/utils'; /** * Number input widget using Ant Design InputNumber component * * This widget provides a numeric input field with support for: * - Min/max constraints from JSON Schema * - Step/multipleOf validation * - Precision control * - Custom formatting and parsing * - Keyboard controls * - All Ant Design InputNumber API properties through uiSchema options * * @example * // In schema * { * type: "number", * minimum: 0, * maximum: 100, * multipleOf: 0.01 * } * * // In uiSchema * { * "ui:widget": "number", * "ui:options": { * placeholder: "Enter amount", * precision: 2, * formatter: value => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','), * parser: value => value.replace(/\$\s?|(,*)/g, ''), * controls: true, * size: "large" * } * } */ declare const NumberWidget: FC<WidgetProps>; export default NumberWidget; export { NumberWidget };