NumberField

Source
import { NumberField } from "@prestojs/viewmodel";
NumberField<ValueT = string|number,ParsableValueT = ValueT>
Hierarchy

API

Constructor

new NumberField(?values)
Params:
ParameterTypeDescription
values
An object with the properties below
values.asyncChoicesAsyncChoicesInterface
values.blankboolean
values.blankAsNullboolean
values.choicesMap|[ValueT, string][]
values.defaultValuenull|ValueT|
values.formatterPropsRecord
values.helpTextstring
values.labelstring
values.maxValuestring|number
values.minValuestring|number
values.readOnlyboolean
values.widgetPropsRecord
values.writeOnlyboolean

Methods

clone()
Returns:Field
contributeToClass(viewModel)
Params:
ParameterTypeDescription
*viewModelViewModelConstructor
Returns:void
format(value)
Params:
ParameterTypeDescription
*valueValueT
Returns:any
getFormatterProps()
Returns:{[fieldName: string]: any }
getWidgetProps()
Returns:{[fieldName: string]: any }
isEqual(value1,value2)
Params:
ParameterTypeDescription
*value1ValueT
*value2ValueT
Returns:boolean
normalize(value)
Params:
ParameterTypeDescription
*valueValueT
Returns:null|ValueT
parse(value)
Params:
ParameterTypeDescription
*valuenull|ValueT
Returns:null|ValueT
toJS(value)
Params:
ParameterTypeDescription
*valueValueT
Returns:null|string|number|Record
toString()
Returns:string

Properties

blank

Source
boolean

blankAsNull

Source
boolean

boundRecord

Source
undefined|ViewModelInterface

choices

Source
Map

defaultValue

Source
undefined|null|ValueT|Promise

formatterProps

Source
Record

helpText

Source
string

isBound

Source
boolean

label

Source
string

maxValue

Source
string|number

minValue

Source
string|number

name

Source
string

readOnly

Source
boolean

value

Source
undefined|ValueT

widgetProps

Source
Record

writeOnly

Source
boolean

Static Properties

fieldClassName

Source
string