@serenity-is/corelib / AutoNumeric
Class: AutoNumeric
Defined in: src/ui/editors/autonumeric.ts:966
A jQuery-independent port of the autoNumeric library for formatting numeric inputs.
Constructors
Constructor
new AutoNumeric():
AutoNumeric
Returns
AutoNumeric
Properties
allowedSettingKeys
readonlystaticallowedSettingKeys:Set<string>
Defined in: src/ui/editors/autonumeric.ts:1315
Setting keys that can be passed through from editor options.
defaults
staticdefaults:AutoNumericOptions
Defined in: src/ui/editors/autonumeric.ts:969
Default autoNumeric options.
Methods
destroy()
staticdestroy(input):void
Defined in: src/ui/editors/autonumeric.ts:1185
Removes autoNumeric settings and event handlers from an input.
Parameters
input
HTMLInputElement
The input element.
Returns
void
getSettings()
staticgetSettings(input):AutoNumericOptions
Defined in: src/ui/editors/autonumeric.ts:1301
Returns the autoNumeric settings for an input.
Parameters
input
HTMLInputElement
The input element.
Returns
The settings.
getValue()
staticgetValue(input):string
Defined in: src/ui/editors/autonumeric.ts:1261
Returns the unformatted numeric value of an input.
Parameters
input
HTMLInputElement
The input element.
Returns
string
The numeric value as a string.
hasInstance()
statichasInstance(input):boolean
Defined in: src/ui/editors/autonumeric.ts:1310
Whether an input has an autoNumeric instance.
Parameters
input
HTMLInputElement
The input element.
Returns
boolean
True when initialized.
init()
staticinit(input,options):void
Defined in: src/ui/editors/autonumeric.ts:993
Initializes autoNumeric on an input element.
Parameters
input
HTMLInputElement
The input element.
options
AutoNumeric options.
Returns
void
setValue()
staticsetValue(input,valueIn):string
Defined in: src/ui/editors/autonumeric.ts:1219
Sets the formatted value of an input.
Parameters
input
HTMLInputElement
The input element.
valueIn
The value to set.
string | number
Returns
string
The formatted value.
updateOptions()
staticupdateOptions(input,options):void
Defined in: src/ui/editors/autonumeric.ts:1195
Updates autoNumeric settings on an input.
Parameters
input
HTMLInputElement
The input element.
options
The options to update.
Returns
void