Add an existing AutoNumeric object (or DOM element) to the local AutoNumeric element list, using the DOM element as the key.
This manages the case where addObject
is used on an AutoNumeric object that already has multiple elements in its local list.
The AutoNumeric element to add.
Execute the {@link AutoNumeric.prototype.clear} method on each AutoNumeric object in the local AutoNumeric element list
true
to clear the the entire input, including the currency sign.
Gets an array containing all the AutoNumeric DOM elements that have been initialized by each other.
An array with all AutoNumeric DOM elements.
Remove all elements from the shared list, effectively emptying it. This is the equivalent of calling {@link AutoNumeric.detach} on each of its elements.
If set to true
, then instead of completely emptying the local list
of each AutoNumeric objects, each one of those keeps itself in its own local list.
Execute the {@link AutoNumeric.prototype.getFormatted} method on each AutoNumeric object in the local AutoNumeric element list.
Return an array of the current formatted values of each AutoNumeric element of the local AutoNumeric element list
Optional callback that, when given, is called with the value and the AutoNumeric instance.
The formatted value for each linked AutoNumeric instance.
Gets a map containing all the AutoNumeric DOM elements that have been initialized by each other. The key is the DOM element, the value the corresponding AutoNumeric instance.
A map with all AutoNumeric instances.
Execute the {@link AutoNumeric.prototype.getLocalized} method on each AutoNumeric object in the local AutoNumeric element list.
Returns the unformatted values (following the outputFormat
) setting of each element
of the local AutoNumeric element list into an array.
Optional callback that, when given, is called with the value and the AutoNumeric instance.
The localized value for each linked AutoNumeric instance.
Execute the {@link AutoNumeric.prototype.getNumber} method on each AutoNumeric object in the local AutoNumeric element list.
Return an array of the element unformatted values (as a real Javascript number), for each element of the local AutoNumeric element list.
Optional callback that, when given, is called with the value and the AutoNumeric instance.
The number value for each linked AutoNumeric instance.
Execute the {@link AutoNumeric.prototype.getNumericString} method on each AutoNumeric object in the local AutoNumeric element list.
Return an array of the unformatted values of each AutoNumeric element of the local AutoNumeric element list
This can also return null
if rawValue
is null.
Optional callback that, when given, is called with the value and the AutoNumeric instance.
The numeric value for each linked AutoNumeric instance.
Return true
if the given AutoNumeric instance (or DOM element) is in the local AutoNumeric element list.
The element to check.
Whether the given element is in the local AutoNumeric element list.
Return true
if all the AutoNumeric-managed elements are pristine, i.e. if their raw value hasn't changed.
By default, this returns true
if the raw unformatted value is still the same even if the formatted one has changed
(due to a configuration update for instance).
If set to true
, the pristine value is done on the raw unformatted value, not the
formatted one. If set to false
, this also checks that the formatted value hasn't changed.
Whether all AutoNumeric-managed elements are pristine.
Execute the {@link AutoNumeric.prototype.nuke} method on each AutoNumeric object in the local AutoNumeric element list.
Execute the {@link AutoNumeric.prototype.reformat} method on each AutoNumeric object in the local AutoNumeric element list.
Force each element of the local AutoNumeric element list to reformat its value.
Execute the {@link AutoNumeric.prototype.remove} method on each AutoNumeric object in the local AutoNumeric element list.
Remove the given AutoNumeric object (or DOM element) from the local AutoNumeric element list, using the DOM element as the key. If this function attempts to remove the current AutoNumeric object from the local list, a warning is shown, but the deletion is still done.
Special cases :
The AutoNumeric element to remove.
If set to false
, then the function will also remove the current AutoNumeric object if asked,
otherwise it will ignore it and print a warning message.
Execute the {@link AutoNumeric.prototype.set} method on each AutoNumeric object in the local AutoNumeric element list.
Set the same given element value for each element in the local AutoNumeric element list, and format those elements immediately.
The new value to set.
A settings object that will override the current settings. Note: the update is done only if the newValue
is defined.
Execute the {@link AutoNumeric.prototype.setUnformatted} method on each AutoNumeric object in the local AutoNumeric element list.
Set the value given value directly as the DOM element value, without formatting it beforehand. This sets the same unformatted value for each element in the local AutoNumeric element list.
The new value to set.
A settings object that will override the current settings. Note: the update is done only if the newValue
is defined.
Return the number of element in the local AutoNumeric element list.
The number of linked AutoNumeric elements.
Execute the {@link AutoNumeric.prototype.unformat} method on each AutoNumeric object in the local AutoNumeric element list.
Remove the formatting and keep only the raw unformatted value (as a numericString) in each element of the local AutoNumeric element list
Execute the {@link AutoNumeric.prototype.unformatLocalized} method on each AutoNumeric object in the local AutoNumeric element list.
Remove the formatting and keep only the localized unformatted value in the element.
Optional override for the default outputFormat
setting if needed.
Execute the {@link AutoNumeric.prototype.update} method on each AutoNumeric object in the local AutoNumeric element list.
Updates the AutoNumeric settings, and immediately format the elements accordingly, for each element of the local AutoNumeric element list.
New options to set. When multiple options are specified, later options override previous options.
Execute the {@link AutoNumeric.prototype.wipe} method on each AutoNumeric object in the local AutoNumeric element list.
Generated using TypeDoc
Whenever {@link init} is used to initialize other DOM elements, a shared local
init
list of those elements is stored in the AutoNumeric instances.This allows for neat things like modifying all those linked AutoNumeric elements globally, with only one call.
Use the {@link AutoNumeric.global} property to access the handler that provides methods to modify all linked elements.