import Field, { FieldProps, ViewModelFieldWidgetProps } from './Field'; /** * @expandproperties */ export interface NumberFieldProps extends FieldProps { /** * The minimum value that should be accepted */ minValue?: number | string; /** * The maximum value that should be accepted */ maxValue?: number | string; } /** * Base class for any numeric fields (see above for more specific fields). * * This class accepts all the props of [Field](doc:Field) as well as the optional * `minValue` and `maxValue` properties which can be used by form widgets to validate * the inputted value * * * * Use with [viewModelFactory](doc:viewModelFactory). * * ```js * viewModelFactory({ * id: new Field(), * age: new NumberField(), * }, { pkFieldName: 'id' }); * ``` * * Optionally provide `minValue`, `maxValue` or any options from [Field](doc:Field): * * ```js * viewModelFactory({ * id: new Field(), * age: new NumberField({ * minValue: 0, * helpText: 'Enter your age' * }), * }, { pkFieldName: 'id' }); * ``` * * * @extractdocs * @menugroup Fields * @typeParam ValueT The type of the numeric value. This could be `number` or `string` or some other object (eg. decimal implementation) * @typeParam ParsableValueT This the type the field knows how to parse into `ValueT` when constructing a `ViewModel`. */ export default class NumberField extends Field { static fieldClassName: string; minValue?: number | string; maxValue?: number | string; constructor(values?: NumberFieldProps); getWidgetProps(): ViewModelFieldWidgetProps; }