1 | ## Changelog for autoNumeric
|
2 |
|
3 | ### 4.0.0-beta.20
|
4 | + Allow initializing an AutoNumeric element with an array of options objects or pre-defined option names.
|
5 | The latter options in the array will overwrite the previous ones.
|
6 | The array can contains either option objects, or pre-defined option names as a string (ie. `'euroPos'`).
|
7 | Both the initialization methods `new AutoNumeric()` and `AutoNumeric.multiple()` support using arrays of options.
|
8 | + Add a static `AutoNumeric.mergeOptions()` function that accepts an array of option objects and / or pre-defined option names, and return a single option object where the latter element overwrite the settings from the previous ones.
|
9 | + Allow passing an array of options objects or pre-defined option names to the static `format` and `unformat` methods.
|
10 | The latter options in the array will overwrite the previous ones.
|
11 | The array can contains either option objects, or pre-defined option names as a string (ie. `'euroPos'`).
|
12 |
|
13 | ### 4.0.0-beta.19
|
14 | + Fix issue #449 `AutoNumeric.unformat()` only removes the first instance of `settings.digitGroupSeparator`
|
15 |
|
16 | ### 4.0.0-beta.18
|
17 | + Modify the `get*` methods to allow passing them a callback function.
|
18 | + The callback is then executed on the `get*` method result, or the `global.get*` method array of result.
|
19 | + The callback is passed the result of the `get*` functions as its first argument, and the current AutoNumeric object as its second.
|
20 | + Split the `_saveValueToPersistentStorage()` method in three : `_saveValueToPersistentStorage()` to save the raw value to persistent storage, `_getValueFromPersistentStorage()` to retrieve that data, and `_removeValueFromPersistentStorage()` to delete it.
|
21 | + From now on, the `_storageTest` is only done once, and the result is kept in `this.sessionStorageAvailable`, and the storage variable name is also generated once and kept in `this.rawValueStorageName`.
|
22 | + You can now modify the raw value storage name variable prefix by modifying the `this.storageNamePrefix` attribute. Currently it defaults to `'AUTO_'`;
|
23 |
|
24 | ### 4.0.0-beta.17
|
25 | + Fix issue #447 Add a new `'null'` options to the `emptyInputBehavior` setting
|
26 | + Add the `this.defaultRawValue` variable that store the hard-coded default raw value used during the initialization and reset.
|
27 | + When using the option `{ emptyInputBehavior: AutoNumeric.options.emptyInputBehavior.null }`, the user can now explicitly set the AutoNumeric value to `null` (using `anElement.set(null)` for instance).
|
28 | Additionally, when this option is set, if the AutoNumeric element is emptied, then `rawValue` is set to `null`.
|
29 | Note: if the current raw value is equal to `null`, changing the `emptyInputBehavior` option to something different than `null` will update the rawValue to `''`.
|
30 | **Known limitation** : Initializing an AutoNumeric object with the `null` value is not allowed since using `null` for the initial value means that AutoNumeric needs to use the current html value instead of `null`.
|
31 | + Fix issue #448 When searching for the parent form element, the tagName can be undefined.
|
32 | + The `form()` method now accepts a `true` argument that will force it to discard the current parent form and search for a new one.
|
33 | + Enforce the use of `settings.showWarnings` for most calls to `AutoNumericHelper.warning()`, wherever possible.
|
34 |
|
35 | ### 4.0.0-beta.16
|
36 | + Move the options, default options and predefined options objects each in its own file.
|
37 | Separating them from the AutoNumeric class makes that information easier to find, study and modify.
|
38 | + Modify the `update()` and `global.update()` function signatures so that they can accept multiple option objects, the latter overwriting the settings from the former.
|
39 | This allows to fine tune the format settings in one go, and is specially useful when using a predefined option as the 'configuration base', and changing it slightly (ie. `anElement.update( AutoNumeric.getPredefinedOptions().French, { digitGroupSeparator: AutoNumeric.options.digitGroupSeparator.noSeparator })`).
|
40 | + Fix the `'autoNumeric:formatted'` event not being correctly sent if the AutoNumeric element was formatted without a `keyup` event.
|
41 | The event is now correctly sent when the value is set to empty, or when using `unformat()`, `unformatLocalized()` and `wipe()`, as well as when the user uses the wheel event to change the element value, or the `alt + mouse hover` feature, or just hover the element that has a `negativeBracketsTypeOnBlur` option set, or on the initial format on load.
|
42 | + Fix the fact that `'autoNumeric:formatted'` was not sent when pasting valid values.
|
43 | + Gather the AutoNumeric event names in a single configuration variable `AutoNumeric.events`.
|
44 | + Modify the default percentage pre-defined option `wheelStep` to `0.01` so that the wheel step is more logical when manipulating a small number.
|
45 | + Fix issue #442 Setting `unformatOnSubmit` to `true` does not unformat the element on the form' `submit` event
|
46 | + Fix issue #440 Pasting does not work in IE11
|
47 |
|
48 | ### 4.0.0-beta.15
|
49 | + Add a new option `selectOnFocus` that allow the user to choose if the value should be selected when the element is focused.
|
50 | + Add a new option `caretPositionOnFocus` that allow the user to choose where should be positioned the caret when the element is focused.
|
51 | + Modify how the caret is treated on focus ; if the `selectOnFocus` option is `true` then the value is selected, otherwise the caret is set at the position defined by the `caretPositionOnFocus` option.
|
52 | + `caretPositionOnFocus` can be `'start'`, `'end'`, `'decimalLeft'` and `'decimalRight'`, and will change where the caret will be positioned when the element get the focus. It can also be `null` which means the caret position is not forced.
|
53 | + The caret position is calculated by the new `_initialCaretPosition()` function.
|
54 | + Modify `validate()` so that an empty object can be used for the options, since the default settings would then be merged and used.
|
55 | + Modify the `validate()` function signature so that it accepts a third argument, the raw options passed by the user, without them having been merged with the default settings. This is useful for checking conflicting options that could be overwritten by the defaults.
|
56 | + Rewrite the call to `validate()` from `areSettingsValid()` to make it more explicit.
|
57 | + Rewrite one test condition in `_onFocusInAndMouseEnter()` so that it's not reserved only for elements that have their `emptyInputBehavior` option set to `focus` anymore.
|
58 | + Add a `focusin` event handler via `_onFocusIn()`, which take care of managing the element content selection on focus.
|
59 | + Add the `_correctCaretPositionOnFocusAndSelectOnFocusOptions()` function that manage the `caretPositionOnFocus` and `selectOnFocus` options in order to prevent any conflict.
|
60 | + Strengthen `setElementSelection()` so that `element.firstChild` is checked for `null` value.
|
61 | + Add a table of contents to the readme and reorganize its chapters.
|
62 |
|
63 | ### 4.0.0-beta.14
|
64 | + Add more bracket types to the `negativeBracketsTypeOnBlur` option ('〈,〉', '「,」', '⸤,⸥', '⟦,⟧', '‹,›' and '«,»')
|
65 | + Reformat the changelog, fix some typos
|
66 | + Modify the static `unformat()` signature to allow multiple options objects to be passed as arguments.
|
67 | Each more option object overwrite the previous ones.
|
68 | This allows to correctly unformat currencies that have a predefined option as its base, but has been slightly modified (ie. `AutoNumeric.unformat('241800,02 €', AutoNumeric.getPredefinedOptions().French, { digitGroupSeparator: AutoNumeric.options.digitGroupSeparator.noSeparator })`, and still get the right result).
|
69 | + Split the `_checkEmpty()` function into `_isElementValueEmptyOrOnlyTheNegativeSign()` and `_orderValueCurrencySymbolAndSuffixText()`. Both new functions only do one thing and one thing only, allowing the code to be rewrote in a clearer way.
|
70 | + Delete the `_checkEmpty()` function.
|
71 | + Simplify `_roundValue()` to make it more legible ; This is done by extracting `_roundCloseTo05()`, `_prepareValueForRounding()` and `_shouldRoundUp()`.
|
72 | + Remove an unnecessary `while` loop in `_stripAllNonNumberCharacters()`
|
73 |
|
74 | ### 4.0.0-beta.13
|
75 | + Modify `init()` so that it allows the user to also pass an array of DOM elements, or a CSS selector as its first argument (cf. issue #388 comments)
|
76 |
|
77 | ### 4.0.0-beta.12
|
78 | + Fix issue #434 Using `noSeparatorOnFocus` set to `noSeparator` should not remove the decimal character on focus
|
79 |
|
80 | ### 4.0.0-beta.11
|
81 | + Merge the Android support from `2.0.12` into `4.0.0-beta.*`
|
82 |
|
83 | ### 2.0.12
|
84 | + Add Android Chrome mobile (version 57) support (note: so far, not all android browsers are supported)
|
85 | + Fix issue #404 On the Android browser, inserted numbers are doubled if the user press the keys quickly on the virtual keyboard
|
86 | + Fix issue #250 The `maximumValue` and `minimumValue` options are not taken into account on Android
|
87 | + Add the special keyCode 229 used by Android browsers as `keyCode.AndroidDefault`
|
88 | + Fix the `onPaste` handler throwing an error for uninitialized variables
|
89 | + Complete the `arabicToLatinNumbers()` function to return more quickly if no arabic numbers are found
|
90 |
|
91 | ### 4.0.0-beta.10
|
92 | + Reorganize the existing unit tests and add more to extend the coverage
|
93 | + Add a new `setValue()` method that allow the user to set any values, without any controls from AutoNumeric.
|
94 | + Replace all the calls to `setElementValue` then `_setRawValue` with either `setValue()` or `_setElementAndRawValue()`, so that this call order is respected.
|
95 | + Rewrite `setUnformatted()` so that it checks and validates the value given by the user.
|
96 | + Fix `options.createLocalList()` so that modifying the option will create/delete the local list accordingly.
|
97 | + Fix `selectDecimal()` so that the decimals are correctly selected when `decimalPlacesShownOnFocus` is used.
|
98 | + Add a thin unbreakable space`\u202f` in front of `%` in the predefined options `percentageEU*` (as per the [typographic rules](https://fr.wikipedia.org/wiki/Pourcentage#Notation)).
|
99 |
|
100 | ### 4.0.0-beta.9
|
101 | + Fix issue #425 The `minimumValue` and `maximumValue` options are not respected when `emptyInputBehavior` is set to `'zero'`
|
102 |
|
103 | ### 2.0.11
|
104 | + Fix issue #248 Create the `autoNumeric` organization, and move the repository to it
|
105 |
|
106 | ### 4.0.0-beta.8
|
107 | + Fix issue #248 Create the `autoNumeric` organization, and move the repository to it
|
108 |
|
109 | ### 4.0.0-beta.7
|
110 | + Fix issue #427 `autoUnformat()` converts `digitGroupSeparator` set to `.` as the decimal character
|
111 | + Modify `AutoNumeric.unformat()` so that 'real' javascript number are always directly returned, without taking into account the options passed (as it was supposed to do previously).
|
112 | + Correctly take into account the number of decimal places, the negative brackets, rounding and the suffix text options when unformatting with `AutoNumeric.unformat()`.
|
113 | + Complete the `AutoNumeric.unformat()` unit tests.
|
114 | + Modify `_removeBrackets()` so that we can only remove the brackets, without reordering the negative sign, currency symbol and value according to the settings.
|
115 |
|
116 | ### 4.0.0-beta.6
|
117 | + Fix issue #414 Changing the value of an element from negative to positive is not possible for some specific configuration of brackets, for the second time.
|
118 | + Remove the need to keep an ambiguous `settings.trailingNegative` variable, that was used for other things that its names suggests.
|
119 | + Extract the `_isTrailingNegative` test to its own function.
|
120 | + Fix `_convertToNumericString()` to make it remove the `suffixText` as well.
|
121 | + Use array destructuring to simplify the `_setValueParts()` function.
|
122 | + Remove the attribute `newValue` polluting `this`, which allow to explicitly pass the needed information.
|
123 | + Merge `this.settings.hasFocus` into `this.isFocused`.
|
124 | + Remove the need for the `this.settings.strip` variable.
|
125 | + Modify the event listener from `'focusin'` to `'focus'`, in order to prepare for the merge of `_onFocusInAndMouseEnter()` and `_onFocus()` handlers.
|
126 | + Modify `_cleanLeadingTrailingZeros()` so that the trailing zeroes if correctly done, even if `leadingZero` is set to `keep`.
|
127 | + Rename `_cleanLeadingTrailingZeros()` to `_trimLeadingAndTrailingZeros()`.
|
128 | + Change the `_addGroupSeparators()` signature so that the focused state is explicitly passed as a parameter, instead of piggy-backing on the settings object.
|
129 | + Add a `_setTrailingNegativeSignInfo()` function that parse the settings and initialize once the `this.isTrailingNegative` property if the negative sign should be trailing for negative values.
|
130 | + Rename the `leftOrAll` parameter from `_stripAllNonNumberCharacters()` to a more meaningful `stripZeros`.
|
131 | + Simplify a test in `_truncateDecimalPlaces()`.
|
132 | + Rename `_skipAlways()` to `_processNonPrintableKeysAndShortcuts()`.
|
133 | + Add cases to the helper function `isNegative()` to make it more efficient.
|
134 | + Add a new `isNegativeWithBrackets()` helper function that tests if the given value is a negative with brackets.
|
135 |
|
136 | ### 4.0.0-beta.5
|
137 | + Fix issue #416 Add support for changing the element style based on rules
|
138 | + Add the `styleRules` option that allows to modify the element style based on the raw value, but also to call any callbacks whenever this raw value change
|
139 | + Reorganize the `set()` function so that the formatted value is set before setting the `rawValue`. That way if a callback invoked by a `styleRules` modify the raw value, it'll be set correctly, since the previous `set()` call would have already changed the element value via `setElementValue()`.
|
140 |
|
141 | ### 4.0.0-beta.4
|
142 | + Fix issue #409 Do not add decimal padding when a number without decimals has been inserted
|
143 | + Fix an issue when you have `allowDecimalPadding` set to `never`, then if you delete the decimal places leaving the decimal character, it would not drop that dangling decimal character on focus out.
|
144 | + Fix issue #418 Complete the documentation with the AutoNumeric event lifecycle
|
145 |
|
146 | ### 4.0.0-beta.3
|
147 | + Fix issue #415 Support undo and redo actions
|
148 | + Add a new `historySize` option that allows to set how many undo states each AutoNumeric object should keep in memory.
|
149 | + Always use the `_setRawValue()` function to set the `rawValue` ; directly setting `this.settings.rawValue = 'foo'` is not allowed anymore.
|
150 | + Modify the `set()` function signature by allowing to pass a third parameter to prevent saving the changed state to the history table.
|
151 | + Update the `keyName` enumeration with the capitalized letters.
|
152 | + Upgrade the `getElementSelection()` helper function in order to support contenteditable-enabled elements and hidden inputs.
|
153 | + Add an `arrayTrim()` helper function that trim the start of an array.
|
154 | + Create undo/redo end-to-end tests.
|
155 | + Reorganize the `set()` function to keep logical steps together.
|
156 | + Rename the old `autoFormat.autoNumeric` event to the already used `autoNumeric:formatted` to keep the names consistent.
|
157 | + Sort the option list in the `_convertOldOptionsToNewOnes()` function.
|
158 | + Fix issue #423 `leadingZero` set to `keep` does not keep the leading zeros under Chrome
|
159 |
|
160 | ### 4.0.0-beta.2
|
161 | + Fix issue #413 Manage the drag 'n drop event so that the text dropped in the AutoNumeric element gets formatted accordingly
|
162 |
|
163 | ### 4.0.0-beta.1
|
164 | + Up the current `next` version to `v4` instead of `v3`, just because.
|
165 | + Add unit tests for the new `options.*` methods
|
166 | + Fix the issue where having `emptyInputBehavior` equal to `always` would not reformat the AutoNumeric element correctly if its value is set to the empty string `''`.
|
167 | + Fix the issue where having `emptyInputBehavior` equal to `zero` would not reformat the AutoNumeric element correctly if its value is set to the empty string `''`.
|
168 | + Fix the `_mergeCurrencySignNegativePositiveSignAndValue()` function that did not manage all `negativePositiveSignPlacement` combinations.
|
169 | + Simplify the `_mergeCurrencySignNegativePositiveSignAndValue()` function.
|
170 | + Add function chaining to the `options.*` methods.
|
171 |
|
172 | ### 3.0.0-beta.14
|
173 | + Add unit tests for the new `global.*` features
|
174 | + Fix issue #412 Using `set('')` does not respect the `emptyInputBehavior` option when it's set to `'always'`
|
175 | + Add a `createLocalList` option which allow to control whether a local list of AutoNumeric objects should be saved on initializations.
|
176 | + Add a `global.update()` function to update the settings on a local list.
|
177 | + Modify the `global.clear()` function to be able to force a `clear` call.
|
178 | + Add a `global.nuke()` function to `remove` then delete the local list DOM element from the DOM.
|
179 | + Update the `global.clear()` function signature with the `clear()` one.
|
180 | + Fix the `global.addObject()` function that did not update the local list of the added element.
|
181 | + Fix the `global.addObject()` function so that if it add an AutoNumeric object that already has a local list with multiple other AutoNumeric objects, it merges the list.
|
182 | + Fix the `global.removeObject()` function to make it update all the objects local list. Also add special behaviors when an AutoNumeric element removes itself or another one.
|
183 | + Fix the `global.empty()` function to match the `removeObject` behavior.
|
184 | + Simplify the `init()` method by removing a negation in one of its parameter.
|
185 | + Fix the `init()` method initialization process by preventing creating a local list, then removing it immediately if the user wanted a detached element. Now, the local list is just not created (Using the `createLocalList` option set to `false`).
|
186 | + Add an end-to-end test for the `remove()` method.
|
187 | + Add a `_hasLocalList()` method that tests if the AutoNumeric element has a local list and that it has at least one element in it (itself usually).
|
188 |
|
189 |
|
190 | ### 3.0.0-beta.13
|
191 | + Fix issue #411 Add the pre-defined Brazilian language configuration
|
192 |
|
193 | ### 3.0.0-beta.12
|
194 | + Refactor the hard-coded option values with the `AutoNumeric.options` object attribute values
|
195 |
|
196 | ### 3.0.0-beta.11
|
197 | + Fix issue #320 Use `event.key` instead of `event.keyCode` and `event.which` since those two attributes are deprecated
|
198 |
|
199 | ### 3.0.0-beta.10
|
200 | + Add lots of pre-defined options.
|
201 | + Those options are `dotDecimalCharCommaSeparator`, `commaDecimalCharDotSeparator`, `integer`, `integerPos`, `integerNeg`, `float`, `floatPos`, `floatNeg`, `numeric`, `numericPos`, `numericNeg`, `euro`, `euroPos`, `euroNeg`, `euroSpace`, `euroSpacePos`, `euroSpaceNeg`, `percentageEU2dec`, `percentageEU2decPos`, `percentageEU2decNeg`, `percentageEU3dec`, `percentageEU3decPos`, `percentageEU3decNeg`, `dollar`, `dollarPos`, `dollarNeg`, `percentageUS2dec`, `percentageUS2decPos`, `percentageUS2decNeg`, `percentageUS3dec`, `percentageUS3decPos` and `percentageUS3decNeg`.
|
202 | + Add the unit tests for those pre-defined options.
|
203 | + Update the readme accordingly, doing a distinction between the 'Predefined language options' and the 'Predefined common options'.
|
204 | + Rename `getLanguages()` to `getPredefinedOptions()`.
|
205 | + Add the percentage, permille and basis point sign to the default `suffixText` options.
|
206 | + Add a test to warn the user when the given CSS selector does not select any element during initialization.
|
207 | + Fix the initialization problem when searching for a parent <form> on an element that has no parentNode.
|
208 | + Re-order alphabetically the default settings
|
209 | + Replace the hard-coded default option values with references to the `AutoNumeric.options` object values.
|
210 | + Re-order alphabetically the options enumeration.
|
211 | + Add more choices for some options.
|
212 | + Rename default options value names to more meaningful descriptions.
|
213 | + Change the default option `selectNumberOnly` value to `true`
|
214 | + Simplify the `AutoNumeric.languageOptions` object.
|
215 | + Add the 'dot' character to the `decimalCharacterAlternative` option enumeration.
|
216 | + Update the end-to-end tests that test the element value selection on focus, to reflect the change to the default value for `selectNumberOnly`.
|
217 | + Update the unit tests to correct the rounding on some values that used the previous default one defined in `AutoNumeric.languageOptions.French`.
|
218 |
|
219 | ### 3.0.0-beta.9
|
220 | + Fix and removes some TODOs and FIXMEs
|
221 | + Remove some debug messages.
|
222 | + Remove the need to initialize the `savedCancellableValue` variable when unneeded.
|
223 | + Check and remove the unnecessary `hasFocus` calls and sets.
|
224 | + Add regex caching to the static `format()` function, since this used the `_addGroupSeparators` function that calls the `_stripAllNonNumberCharacters` one that extensively uses those.
|
225 | + Rename the temporary settings copy, and move those out of the `this.settings` object.
|
226 | + Prevent setting the value with `set()` if the value hasn't changed when calling the 'cancellable' event.
|
227 | + Rename `_setsAlternativeDecimalSeparatorCharacter()` to `_setAlternativeDecimalSeparatorCharacter()`.
|
228 | + Remove the unused and deprecated `aScale` reference from a test.
|
229 | + Move away from the `this.settings` object the following variables : `caretFix`, `throwInput`, `tagList`, `originalDecimalPlacesOverride`, `originalAllowDecimalPadding`, `originalNegativeBracketsTypeOnBlur`, `originalDigitGroupSeparator`, `originalCurrencySymbol`, `originalSuffixText` and `aNegRegAutoStrip`.
|
230 | + Refactor some tests in `_formatValue()`.
|
231 |
|
232 | ### 3.0.0-beta.8
|
233 | + Fix issue #408 Allow brackets and parenthesis to be added for negative numbers on any combination of `currencySymbolPlacement` and `negativePositiveSignPlacement` values
|
234 |
|
235 | ### 3.0.0-beta.7
|
236 | + Rename autoNumeric.js to AutoNumeric.js (since it's now a module)
|
237 |
|
238 | ### 3.0.0-beta.6
|
239 | + Finish merging the fixes for #403 and #401 into v3, and fix the introduced bugs
|
240 | + Make sure that if an element is focused, and a `mouseleave` event is captured, we do not unformat the element value (with the scale options).
|
241 | + Make sure if the element value is empty, that the scaleDivisor option do not convert it to `'0.00'` on `mouseenter`.
|
242 | + Remove a ternary operator which lead to a variable overwriting itself.
|
243 | + Fix the end-to-end tests which test the percentage with the scale options.
|
244 |
|
245 | ### 2.0.9
|
246 | + Fix issue #401 autoNumeric 2.0.8 prevents IE11 from entering the decimal character from the numpad
|
247 | + Fix issue #403 autoNumeric 2.0.8 scaling option when the divisor is less than zero and the input receives focus multiple times
|
248 |
|
249 | ### 3.0.0-beta.5
|
250 | + Fix issue #395 Allow to show the unformatted value when hovering over the element and pressing `Alt`
|
251 |
|
252 | ### 3.0.0-beta.4
|
253 | + Fix issue #396 Allow autoNumeric to manage user inputs in `contentEditable`-enabled elements
|
254 | + Simplify the `_formatDefaultValueOnPageLoad()` method signature.
|
255 | + Simplify how the `update()` function retrieve the current raw value and one of its test.
|
256 | + Remove any direct access to `this.domElement.value`, and use the `getElementValue()` to access the element `value` or `textContent`, and `setElementValue()` to set it.
|
257 | + Rewrite the `getElementSelection()` and `setElementSelection()` functions in order to manage non-input DOM elements.
|
258 | + Strengthen `getElementValue()` when managing non-input DOM elements.
|
259 |
|
260 | ### 3.0.0-beta.3
|
261 | + Fix issue #399 Fully convert autoNumeric to an ES6 module
|
262 | + Fix issue #398 Finish removing all jQuery dependencies
|
263 | + Fix issue #244 \[Feature request] Remove the jQuery dependency
|
264 | + Add an entry point `src/main.js` for bundling the library.
|
265 | + Split the library into 3 files ;
|
266 | - `autoNumeric.js`, which contains the AutoNumeric class,
|
267 | - `AutoNumericEnum.js` which contains the enumerations used by AutoNumeric, and
|
268 | - `AutoNumericHelper.js` which contains the AutoNumericHelper class which provides static helper functions.
|
269 |
|
270 | + Extract the `allowedTagList`, `keyCode` and `keyName` into `AutoNumericEnum`.
|
271 | + Add the `isEmptyString`, `isNumberOrArabic`, `isFunction`, `isElement`, `isInputElement`, `arabicToLatinNumbers`, `triggerEvent`, `randomString`, `getElementValue`, `setElementValue`, `cloneObject`, `camelize`, `text`, `setText` and `filterOut` functions to the helper functions.
|
272 | + Move the `preparePastedText`, `runCallbacksFoundInTheSettingsObject`, `maximumVMinAndVMaxDecimalLength`, `stripAllNonNumberCharacters`, `toggleNegativeBracket`, `convertToNumericString`, `toLocale`, `modifyNegativeSignAndDecimalCharacterForRawValue`, `modifyNegativeSignAndDecimalCharacterForFormattedValue`, `checkEmpty`, `addGroupSeparators`, `truncateZeros`, `roundValue`, `truncateDecimal`, `checkIfInRangeWithOverrideOption` functions into the AutoNumeric object.
|
273 | + Improve the `character()` method to take into account the quirks of some obsolete browsers.
|
274 | + Remove the `getCurrentElement()` function since we now only need to access the `this.domElement` property.
|
275 | + Remove the `AutoNumericHolder` class and the `getAutoNumericHolder()` function since we are now using the AutoNumeric class as the 'property holder'.
|
276 | + Add multiple ways to initialize an AutoNumeric element (cf. the AutoNumeric constructor and the `_setArgumentsValues()` method).
|
277 | + Simplify the input type and tag support check.
|
278 | + Add the `serializeSpaces` option that allows the user to defines how the serialize function will managed the spaces, either by converting them to `'%20'`, or to the `'+'` string, the latter now being the default.
|
279 | + Add the `noEventListeners` option that allows the user to initialize an AutoNumeric `<input>` element without adding any AutoNumeric event listeners.
|
280 | + Add the `readOnly` option to the settings that allow the `<input>` element to be set to read-only on initialization.
|
281 | + Add a feature where all AutoNumeric-managed elements in a page share a common list.
|
282 | + Add a feature where the AutoNumeric-managed elements that initialized each other share a common list, allowing the user to perform a single action on many elements at once (via the `.global.*` functions).
|
283 | + Add a `isPristine()` method to test if an AutoNumeric-managed element `value`/`textContent` has been changed since its initialization.
|
284 | + Rename `unset` to `unformat`.
|
285 | + Rename `reSet` to `reformat`.
|
286 | + Add an `unformatLocalized()` function to unformat the element value while using the `outputFormat` setting.
|
287 | + Add a `clear()` method to empty the element value.
|
288 | + Add a `nuke()` method to remove the DOM element from the DOM tree.
|
289 | + Add a `.global.has()` method to check if the given AutoNumeric object (or DOM element) is in the local AutoNumeric element list.
|
290 | + Add a `.global.addObject()` method that adds an existing AutoNumeric object (or DOM element) to the local AutoNumeric element list.
|
291 | + Add a `.global.removeObject()` method that removes the given AutoNumeric object (or DOM element) from the local AutoNumeric element list.
|
292 | + Add a `.global.empty()` method to remove all elements from the shared list.
|
293 | + Add a `.global.elements()` method to retrieve all the AutoNumeric object that share the same local list.
|
294 | + Add a `.global.getList()` method to retrieve the local AutoNumeric element list.
|
295 | + Add one function for updating each option individually (ie. anElement.options.decimalCharacter('.')) instead of having to pass an object.
|
296 | + Add a `version()` method to output the current AutoNumeric version (for debug purpose).
|
297 | + Fix the `set()` method so that the `rawValue` is updated when the value is set to `''`.
|
298 | + Add a `setUnformatted()` method to set the value given value directly as the DOM element value, without formatting it beforehand.
|
299 | + Deprecate the `get()` method to the renamed `getNumericString()` which bares more meaning.
|
300 | + Add a `getFormatted()` method to retrieve the current formatted value of the AutoNumeric element as a string.
|
301 | + Add a `getNumber()` method that returns the element unformatted value as a real Javascript number.
|
302 | + Add a `getLocalized()` method that returns the unformatted value, but following the `outputFormat` setting.
|
303 | + Add a `unformatLocalized()` method that unformats the element value by removing the formatting and keeping only the localized unformatted value in the element.
|
304 | + Add a `selectNumber()` method that select only the numbers in the formatted element content, leaving out the currency symbol, whatever the value of the `selectNumberOnly` option.
|
305 | + Add a `selectInteger()` method that select only the integer part in the formatted element content, whatever the value of the `selectNumberOnly` option.
|
306 | + Add a `selectDecimal()` method that select only the decimal part in the formatted element content, whatever the value of `selectNumberOnly`.
|
307 | + Add a `node()` method that returns the DOM element reference of the autoNumeric-managed element.
|
308 | + Add a `parent()` method that returns the DOM element reference of the parent node of the autoNumeric-managed element.
|
309 | + Add a `detach()` method that detach the current AutoNumeric element from the shared local 'init' list.
|
310 | + Add an `attach()` method that attach the given AutoNumeric element to the shared local 'init' list.
|
311 | + Add a `formatOther()` method that format and return the given value, or set the formatted value into the given DOM element if one is passed as an argument.
|
312 | + Add an `unformatOther()` method that unformat and return the raw numeric string corresponding to the given value, or directly set the unformatted value into the given DOM element if one is passed as an argument.
|
313 | + Add an `init()` method that allows to use the current AutoNumeric element settings to initialize the DOM element given as a parameter. This effectively *link* the two AutoNumeric element by making them share the same local AutoNumeric element list.
|
314 | + Add a `form()` method that return a reference to the parent <form> element if it exists, otherwise return `null`.
|
315 | + Add a `formNumericString()` method that returns a string in standard URL-encoded notation with the form input values being unformatted.
|
316 | + Add a `formFormatted()` method that returns a string in standard URL-encoded notation with the form input values being formatted.
|
317 | + Add a `formLocalized()` method that returns a string in standard URL-encoded notation with the form input values, with localized values.
|
318 | + Add a `formArrayNumericString()` method that returns an array containing an object for each form `<input>` element.
|
319 | + Add a `formArrayFormatted()` method that returns an array containing an object for each form `<input>` element, with the value formatted.
|
320 | + Add a `formArrayLocalized()` method that returns an array containing an object for each form `<input>` element, with the value localized.
|
321 | + Add a `formJsonNumericString()` method that returns a JSON string containing an object representing the form input values.
|
322 | + Add a `formJsonFormatted()` method that returns a JSON string containing an object representing the form input values, with the value formatted.
|
323 | + Add a `formJsonLocalized()` method that returns a JSON string containing an object representing the form input values, with the value localized.
|
324 | + Add a `formUnformat()` method that unformat all the autoNumeric-managed elements that are a child of the parent <form> element of this DOM element, to numeric strings.
|
325 | + Add a `formUnformatLocalized()` method that unformat all the autoNumeric-managed elements that are a child of the parent <form> element of this DOM element, to localized strings.
|
326 | + Add a `formReformat()` method that reformat all the autoNumeric-managed elements that are a child of the parent <form> element of this DOM element.
|
327 | + Add a `formSubmitNumericString()` method that convert the input values to numeric strings, submit the form, then reformat those back.
|
328 | + Add a `formSubmitFormatted()` method that submit the form with the current formatted values.
|
329 | + Add a `formSubmitLocalized()` method that convert the input values to localized strings, submit the form, then reformat those back.
|
330 | + Add a `formSubmitArrayNumericString()` method that generate an array of numeric strings from the `<input>` elements, and pass it to the given callback.
|
331 | + Add a `formSubmitArrayFormatted()` method that generate an array of the current formatted values from the `<input>` elements, and pass it to the given callback.
|
332 | + Add a `formSubmitArrayLocalized()` method that generate an array of localized strings from the `<input>` elements, and pass it to the given callback.
|
333 | + Add a `formSubmitJsonNumericString()` method that generate a JSON string with the numeric strings values from the `<input>` elements, and pass it to the given callback.
|
334 | + Add a `formSubmitJsonFormatted()` method that generate a JSON string with the current formatted values from the `<input>` elements, and pass it to the given callback.
|
335 | + Add a `formSubmitJsonLocalized()` method that generate a JSON string with the localized strings values from the `<input>` elements, and pass it to the given callback.
|
336 | + Add a static `test()` method that if the given domElement is already managed by AutoNumeric (if it has been initialized on the current page).
|
337 | + Add multiple private methods to create and delete a global list of AutoNumeric objects (via a WeakMap), as well as the methods to add and remove elements to that list.
|
338 | + Add multiple private methods to manage the local enumerable list of AutoNumeric objects that are initialized together and share a common local list.
|
339 | + Add the private methods `_mergeSettings()` and `_cloneAndMergeSettings()` to do what they are named about.
|
340 | + Modify the static `format()` method so that it formats the given number (or numeric string) with the given options, and returns the formatted value as a string.
|
341 | + Add a static `formatAndSet()` method that format the given DOM element value, and set the resulting value back as the element value.
|
342 | + Modify the static `unformat()` method so that it unformats the given formatted string with the given options, and returns a numeric string.
|
343 | + Add a static `unformatAndSet()` method that unformat the given DOM element value, and set the resulting value back as the element value.
|
344 | + Add a static `localize()` method that unformat and localize the given formatted string with the given options, and returns a numeric string.
|
345 | + Add a static `isManagedByAutoNumeric()` method that returns `true` is the given DOM element has an AutoNumeric object that manages it.
|
346 | + Add a static `getAutoNumericElement()` method that returns the AutoNumeric object that manages the given DOM element.
|
347 | + Add the `french()`, `northAmerican()`, `british()`, `swiss()`, `japanese()`, `spanish()` and `chinese()` methods that update the settings to use the named pre-defined language options.
|
348 | + Convert some cryptic ternary statements to if/else block.
|
349 | + Remove the unknown parameter `setReal` from some functions.
|
350 | + Remove the need to pass around the settings in many functions signatures (using `this.settings` directly).
|
351 | + Rename the temporary variables created by coping some settings, with the new option names.
|
352 | + Correct the warning shown when using `isNan()` on non-number elements like strings.
|
353 | + Keep the focus status of the DOM element in the new `this.isFocused` variable.
|
354 | + Use the `getElementValue()` function to retrieve the element `value` or `textContent` (depending if the element in an `<input>` or another tag), which allow AutoNumeric to perform some operations on non-input elements too. This is the first changes needed for the goal of managing the non-input tags with `contentEditable` with AutoNumeric.
|
355 | + Use the `getElementValue()` function as well in order to be able to set the `value` or `textContent` transparently where needed.
|
356 | + Rename `_updateAutoNumericHolderProperties()` to `_updateInternalProperties()`.
|
357 | + Complete some JSDoc to be more precise on the event or element types. This helps for IDE autocompletion.
|
358 | + Rewrite completely how AutoNumeric test if the given DOM element is supported or not (by using the new `_checkElement()` method). This simplify the process by calling the new `_isElementTagSupported()`, `_isInputElement()` and `_isInputTypeSupported()` functions which respect the separation of concerns.
|
359 | + The `_formatDefaultValueOnPageLoad()` method now accepts a 'forced' initial value instead of the default one.
|
360 | + Remove the tests about the input type or element support from the `set()` methods, since those cannot change once AutoNumeric has been initialized, simplifying the code.
|
361 | + Remove duplicated tests (ie. `settings.formatOnPageLoad` inside the `formatDefaultValueOnPageLoad()` function that is only called if `settings.formatOnPageLoad` is already set).
|
362 | + Rename the `getInitialSettings()` method to `_setSettings()`.
|
363 | + Use array destructuring to give more meaningful names to the data returned by the `_getSignPosition()` function.
|
364 | + Add a private `_serialize()` function that take care of serializing the form data into multiple output as needed, which is called by the `_serializeNumericString()`, `_serializeFormatted()`,`_serializeLocalized()`, `_serializeNumericStringArray()`, `_serializeFormattedArray()` and `_serializeLocalizedArray()` methods.
|
365 | + The default settings are now exposed on the AutoNumeric class as a static object `AutoNumeric.defaultSettings`.
|
366 | + Add the static `AutoNumeric.options` object that gives access to all the possible options values, with a semantic name (handy for IDE autocompletion).
|
367 | + The pre-defined language options objects are now accessible via the static `AutoNumeric.languageOptions` object.
|
368 | + Add the static `AutoNumeric.multiple()` function that allows to initialize numerous AutoNumeric object (on numerous DOM elements) in one call (and possibly pass multiple values that will be mapped to each DOM element).
|
369 | + Add end-to-end tests for initializing non-`<input>` tags.
|
370 | + Add e2e tests for initializing elements with the `noEventListeners` or `readOnly` options.
|
371 | + Convert the end-to-end tests to the new API v3.
|
372 | + Convert the unit tests to the new API v3.
|
373 | + Add unit tests for the `serializeSpaces`, `noEventListeners` and `readOnly` options.
|
374 | + Fix the unit tests checking that the `rawValue` was correctly set when using `getSettings()`.
|
375 | + Add unit tests to check the `.global.*` methods.
|
376 | + Add unit tests to check the `AutoNumeric.multiple()` methods.
|
377 | + Add unit tests to check the `selectDecimal`, `selectInteger`, `reformat`, `unformat` and `unformatLocalized` methods.
|
378 | + Add unit tests to check the `.form*` methods.
|
379 | + Add the `babel-plugin-transform-object-assign` dev dependency in order to be able to use `Object.assign()` in the ES6 source.
|
380 |
|
381 | ### 3.0.0-beta.2
|
382 | + Fix issue #393 Add an option `modifyValueOnWheel` that allow the user to use mouse wheel to increment/decrement the element value
|
383 | + The related `wheelStep` option allows to either define a *fixed* step (ie. `1000`), or a *progressive* one calculated based on the current element value
|
384 | + Fix issue #397 Create enumerations for every options that allows only a set of values
|
385 |
|
386 | ### 3.0.0-beta.1
|
387 | + Fix issue #387 Add a 'cancellable' feature
|
388 | + It's now possible to select the whole input by hitting the `Escape` key (if no changes have been made to the element value, otherwise this will cancel those changes if the `isCancellable` is set to `true`)
|
389 | + Fix issue #391 The currency symbol is selected when focusing on an input via the `Tab` key, when `selectNumberOnly` is set to `true`
|
390 | + Refactor the code to create a `_selectOnlyNumbers()` function that extract that behavior for re-use.
|
391 | + Create a `_select()` function that select the whole element content, while respecting the `selectNumberOnly` option.
|
392 | + Create a `_defaultSelectAll()` function that select the whole element content, including all characters.
|
393 | + Modify the `setElementSelection()` calls to simplify them with the ability to use one argument instead of two when the `start` and `end` position are the same.
|
394 | + Add a feature where when the user hit 'Escape', the element content is selected (cf. issue #387).
|
395 |
|
396 | ### 2.0.8
|
397 | + Fix issue #389 autoNumeric 2.0.7 npm packages causes build error with typescriptify + browserify
|
398 |
|
399 | ### 2.0.5", "2.0.6" & "2.0.7
|
400 | + Fix issue #384 `npm install` for version 2.0.4 does not work on Windows machines
|
401 |
|
402 | ### 2.0.2", "2.0.3" & "2.0.4
|
403 | + Fix issue #377 The `dist` files in the last publish to npmjs were not rebuilt with the fixes pushed to 2.0.1
|
404 | + Fix issue #373 The `dist` files are not included when publishing to npmjs
|
405 | + Fix issue #371 The currency symbol is not removed on blur with the default `emptyInputBehavior` value `focus`
|
406 | + Fix issue #367 The package.json "postinstall" task does not find the target file when not using the dev dependencies
|
407 |
|
408 | ### 2.0.1
|
409 | + Fix issue #373 The `dist` files are not included when publishing to npmjs
|
410 |
|
411 | ### 2.0.0
|
412 | + Release autoNumeric version `2.0.0`, enjoy! (¬‿¬) :tada:
|
413 | + The old options names are being deprecated, and will be removed *soon* ; update your scripts with the [new ones](README.md#options)!
|
414 | + Please be sure to read the updated [readme](README.md) in order to know what else has changed.
|
415 |
|
416 | ### 2.0.0-beta.25
|
417 | + Fix issue #310 Setup Webdriver.io for end-to-end (e2e) testing
|
418 |
|
419 | ### 2.0.0-beta.24
|
420 | + Fix issue #326 Pasting a single decimal character into an input that has none does not work
|
421 | + Fix issue #322 Pasting a string containing a comma set the caret position at the wrong position
|
422 |
|
423 | ### 2.0.0-beta.23
|
424 | + Fix issue #354 Setup automated coverage tests (with Coveralls)
|
425 |
|
426 | ### 2.0.0-beta.22
|
427 | + Fix issue #345 Setup continuous integration testing (with Travis CI)
|
428 |
|
429 | ### 2.0.0-beta.21
|
430 | + Fix issue #346 Add a `showPositiveSign` option to display the positive sign wherever needed
|
431 |
|
432 | ### 2.0.0-beta.20
|
433 | + Fix issue #341 Add some default options in the `languageOption` object
|
434 | + Fix issue #328 Switch from `npm` to `yarn`
|
435 |
|
436 | ### 2.0.0-beta.19
|
437 | + Allow using `set` with Arabic and Persian numbers (ie. `aNInput.autoNumeric('set', '١٠٢٣٤٥٦٧.٨٩');`)
|
438 | + Allow using Arabic and Persian numbers (used in Arabic languages) in the html `value` attribute
|
439 | + Allow pasting Arabic and Persian numbers (that will get converted to latin numbers on the fly)
|
440 |
|
441 | ### 2.0.0-beta.18
|
442 | + Fix issue #330 The `negativePositiveSignPlacement` option can be ignored in some cases
|
443 | + Fix issue #339 `get` returns `'0'` when the input is empty even if `emptyInputBehavior` is not equal to `'zero'`
|
444 |
|
445 | ### 2.0.0-beta.17
|
446 | + Fix issue #317 Jump over the decimal character when trying to enter a number and the integer part limit has already been attained
|
447 | + Fix issue #319 'get' returns wrong value when the value has a trailing negative sign
|
448 | + Fix issue #327 When focusing on an input via the `Tab` key, the value is not always selected
|
449 |
|
450 | ### 2.0.0-beta.16
|
451 | + Fix issue #321 Allows more international decimal characters and grouping separators :
|
452 | + Allowed grouping separator : `','`, `'.'`, `'٬'`, `'˙'`, `"'"`, `' '`, `'\u2009'`, `'\u202f'`, `'\u00a0'` and `''`
|
453 | + Allowed decimal characters : `'.'`, `','`, `'·'`, `'⎖'` and `'٫'`
|
454 |
|
455 | ### 2.0.0-beta.15
|
456 | + Fix FireFox on issue #306 that allows the caret to move right when all zero present in the decimals
|
457 | + Fix issue #318 `this.selection` can be uninitialized if you focus on an input via the `Tab` key.
|
458 | + Add the `keyName` object that list the key values as defined is the KeyboardEvent Key_Values.
|
459 | + Rename the `key()` function to `keyCodeNumber()`.
|
460 | + Split `_updateFieldProperties()` into `_updateAutoNumericHolderProperties()` and `_updateAutoNumericHolderEventKeycode()`.
|
461 | + `_updateAutoNumericHolderProperties()` only update the value and selection in each event handler, and resets the 'processed' and 'formatted' states.
|
462 | + `_updateAutoNumericHolderEventKeycode()` is called only once on `keypress`, and set the event keyCode into the AutoNumericHolder object.
|
463 | + Remove the need to save `this.ctrlKey`, `this.cmdKey` and `this.shiftKey` three times on each key stroke.
|
464 | + Rename `this.kdCode` into `this.eventKeyCode`, and use that variable globally in the AutoNumericHolder object.
|
465 | + Fix `_normalizeParts()` so that a '0' entered via the numpad is managed as well.
|
466 | + Complete the substitution of magic numbers with `keyCode` values.
|
467 | + Modify `_processCharacterInsertion()` so that it take the event as an argument, and therefore can directly use `e.key`.
|
468 | + Simplify `_formatValue()` tests.
|
469 |
|
470 | ### 2.0.0-beta.14
|
471 | + Fix issue #306 when { leadingZero: 'deny' } and proper caret placement
|
472 |
|
473 | ### 2.0.0-beta.13
|
474 | + Fix issue #228 Do not modify the current selection when trying to input an invalid character
|
475 | + Mass rename functions to gives them a more explicit name :
|
476 |
|
477 | | Old name | | New name |
|
478 | | :---------------- | :------------ | :-----------: |
|
479 | | autoCheck() | -> | checkIfInRangeWithOverrideOption() |
|
480 | | autoRound() | -> | roundValue() |
|
481 | | autoGroup() | -> | addGroupSeparators() |
|
482 | | fixNumber() | -> | modifyNegativeSignAndDecimalCharacterForRawValue() |
|
483 | | presentNumber() | -> | modifyNegativeSignAndDecimalCharacterForFormattedValue() |
|
484 | | negativeBracket() | -> | toggleNegativeBracket() |
|
485 | | autoGet() | -> | getCurrentElement() |
|
486 | | getHolder() | -> | getAutoNumericHolder() |
|
487 | | autoSave() | -> | saveValueToPersistentStorage() |
|
488 | | _setPosition() | -> | _setCaretPosition() |
|
489 | | _signPosition() | -> | _getSignPosition() |
|
490 | | _formatQuick() | -> | _formatValue() |
|
491 |
|
492 | ### 2.0.0-beta.12
|
493 | + Modify the `validate()` function to show a warning when `decimalPlacesOverride` is greater than `decimalPlacesShownOnFocus`.
|
494 | + Implement feature request #183 that manage invalid results when trying to paste any number. This adds the `onInvalidPaste` option that can accept the `error`, `ignore`, `clamp`, `truncate` and `replace` value.
|
495 | + Rename `autoStrip()` to `stripAllNonNumberCharacters()`.
|
496 | + Upgrade the `setElementSelection()` function so that it can accept only one caret position.
|
497 | + Add a `failOnUnknownOption` option which allows autoNumeric to strictly analyse the options passed, and fails if an unknown options is used in the settings object.
|
498 |
|
499 | ### 2.0.0-beta.11
|
500 | + Fix typos and missing characters that prevented building the library.
|
501 |
|
502 | ### 2.0.0-beta.10
|
503 | + Fix issue #302 `leadingZero` option `deny` does not function correctly and deletes some of the zero to the right of the caret
|
504 | + Fix issue #303 When focusing on an input having `currencySymbolPlacement` set as `p` (prefix)
|
505 |
|
506 | ### 2.0.0-beta.9
|
507 | + Rename the old options name to more explicit ones :
|
508 |
|
509 | | Old name | | New name |
|
510 | | :------------ | :------------ | :-----------: |
|
511 | | aSep | -> | digitGroupSeparator |
|
512 | | nSep | -> | noSeparatorOnFocus |
|
513 | | dGroup | -> | digitalGroupSpacing |
|
514 | | aDec | -> | decimalCharacter |
|
515 | | altDec | -> | decimalCharacterAlternative |
|
516 | | aSign | -> | currencySymbol |
|
517 | | pSign | -> | currencySymbolPlacement |
|
518 | | pNeg | -> | negativePositiveSignPlacement |
|
519 | | aSuffix | -> | suffixText |
|
520 | | oLimits | -> | overrideMinMaxLimits |
|
521 | | vMax | -> | maximumValue |
|
522 | | vMin | -> | minimumValue |
|
523 | | mDec | -> | decimalPlacesOverride |
|
524 | | eDec | -> | decimalPlacesShownOnFocus |
|
525 | | scaleDecimal | -> | scaleDecimalPlaces |
|
526 | | aStor | -> | saveValueToSessionStorage |
|
527 | | mRound | -> | roundingMethod |
|
528 | | aPad | -> | allowDecimalPadding |
|
529 | | nBracket | -> | negativeBracketsTypeOnBlur |
|
530 | | wEmpty | -> | emptyInputBehavior |
|
531 | | lZero | -> | leadingZero |
|
532 | | aForm | -> | formatOnPageLoad |
|
533 | | sNumber | -> | selectNumberOnly |
|
534 | | anDefault | -> | defaultValueOverride |
|
535 | | unSetOnSubmit | -> | unformatOnSubmit |
|
536 | | outputType | -> | outputFormat |
|
537 | | debug | -> | showWarnings |
|
538 |
|
539 | + Add a `convertOldOptionsToNewOnes()` function that automatically convert old options to new ones, to ease the evolution to v2.*.
|
540 | + Update `typings.d.ts` accordingly
|
541 | + Update `README.md` accordingly
|
542 | + Complete the tests to make sure using old option names will output a warning about them being deprecated
|
543 |
|
544 | ### 2.0.0-beta.8
|
545 | + Fix issue #292 where native input and change events are not sent correctly.
|
546 | + Add a `isNumber()` helper function to test if a value is a number, or a string representing a number.
|
547 | + Add a `isInt()` helper function to test if a value is a 'real' integer.
|
548 | + Modify `decimalPlaces()` so that it always return the number of decimal places (ie. `0` instead of `null` if there is none).
|
549 | + Add a `key()` helper function to retrieve an event keyCode.
|
550 | + Complete and improve some JSDoc.
|
551 | + Rename `runCallbacks()` into `runCallbacksFoundInTheSettingsObject()`.
|
552 | + Simplify `decLength()` function, as well as removing unnecessary code before each call to this function.
|
553 | + Rename `decLength()` to `maximumVMinAndVMaxDecimalLength()`.
|
554 | + Drastically improve performance by removing duplicated function calls.
|
555 | + Improve `autoCode()` call hierarchy.
|
556 | + Merge `autoCode()` into `getInitialSettings()`.
|
557 | + Caches an additional regex.
|
558 | + Rename some functions and variables to make them more explicit.
|
559 | + Refactor `autoGroup()` to use switch statements.
|
560 | + Refactor how `dPos` was used to make it more understandable.
|
561 | + Rename `keepOriginalSettings` into `keepAnOriginalSettingsCopy()`.
|
562 | + Simplify `autoSave()` so that it directly uses the element as an argument, instead of a jQuery reference.
|
563 | + Create an AutoNumericHolder ES6 class to store the field properties of an autoNumeric element.
|
564 | + Rename the AutoNumericHolder `init()` function to `_updateFieldProperties()`.
|
565 | + Rename the AutoNumericHolder functions that should be private.
|
566 | + Fix issue #283.
|
567 | + Rename `processAlways()` into `_processCharacterDeletion()`, and simplify it so that if does not do two things at the same time.
|
568 | + Rename `processKeypress()` into `_processCharacterInsertion()`, and simplify it so that if does not do two things at the same time.
|
569 | + Merge some conditions in `_formatQuick()`.
|
570 | + Remove the need for a jQuery dependency in the events listeners.
|
571 | + Convert some jQuery event listeners to pure JS event listeners.
|
572 | + Convert some jQuery-specific functions to native JS ones (ie. `$this.val()` to `e.target.value`).
|
573 | + Simplify the event listeners by removing any unused returns.
|
574 | + Remove unnecessary `getHolder()` calls in the event listeners.
|
575 | + Make the 'enter' key send a `change` event when used and the value has been changed.
|
576 | + Add an `onBlur` event listener, allowing us to trigger `change` events as needed.
|
577 | + Reduce `getInitialSettings()` length by a great deal, making it easier to read and understand.
|
578 | + The `getInitialSettings()` functions now calls the `calculateVMinAndVMaxIntegerSizes()`, `correctMDecOption()`, `setsAlternativeDecimalSeparatorCharacter()`, `cachesUsualRegularExpressions()` and `transformOptionsValuesToDefaultTypes()` functions.
|
579 | + Refactor the `update()` code into `getInitialSettings()`, which allows to remove the `autoCode()` calls from the AutoNumericHolder constructor and the `_updateFieldProperties()` function.
|
580 | + Remove the need for jQuery in `getSettings()`.
|
581 | + Modify the `validate()` test on the `mDec` option to allow for a positive integer too.
|
582 | + Allow the `autoFormat()` function to format numbers represented as a string.
|
583 | + Complete the `autoFormat()` tests and check for the value validity.
|
584 | + Remove the `sendCustomEvent()` function and replace it by the `triggerEvent()` one (and remove `createCustomEvent()` as well).
|
585 | + Complete the `autoUnFormat()` tests and check for the value validity.
|
586 | + Modify the `autoUnFormat()` behavior so that when given a number (a real one or a string representing one), the function always return a 'real' number, whatever the options passed.
|
587 | + Modify the eslint 'radix' rule to allow for always specifying a radix for the `parseInt` function.
|
588 | + Comment out the default Jasmine test in order to see a 100% success without any skipped tests.
|
589 | + Fix the `clean:build` npm script so that it does not try to remove an inexistant folder.
|
590 |
|
591 | ### 2.0.0-beta.7
|
592 | + Add "mouseenter" & "mouseleave" handlers to enable viewing the extended values for "eDec", "scaleDivisor" & "nSep" options.
|
593 | + Add third parameter to the "autoGet" call in "onFocusOutAndMouseLeave" function
|
594 |
|
595 | ### 2.0.0-beta.6
|
596 | + Rename the `localOutput` setting to `outputType`, and add an option 'number' that makes `getLocalized` always return a Number, instead of a string.
|
597 | + Modify the `get` function so that it always returns a valid Number or string representing a number that Javascript can interpret.
|
598 | + Add a `getLocalized` function that return the raw value of the input, but can also return the value localized with a decimal point and negative sign placement chosen by the user (basically, it replace the old `get` behavior if any user wants it back).
|
599 | + Modify the `pNeg` default value based on the `aSign` and `pSign` values. This leads to better user experience when setting a currency symbol without setting `pNeg`.
|
600 | + Errors are now always thrown. The `debug` option now only affects the warning messages (used for non-critical errors).
|
601 |
|
602 | ### 2.0.0-beta.5
|
603 | + Add a `validate()` method that checks if the given options object is valid.
|
604 | + Reorganize the `init` function code to check for critical error first, before doing other calculus.
|
605 | + Add a `areSettingsValid()` method that return true if the options object is valid.
|
606 | + Add multiple helper functions `isBoolean`, `isNull`, `isTrueOrFalseString`, `isObject`, `isEmptyObj`, `hasDecimals`, `decimalsPlaces`.
|
607 | + Add a `warning()` method that output warning message to the console.
|
608 | + Rename `originalSettings` to `keepOriginalSettings` to better convey what this function is doing.
|
609 |
|
610 | ### 2.0.0-beta.4
|
611 | + Removed the index.html file
|
612 | + Additional mods/fixes to the scaling options
|
613 | + Additional mods/fixes to the "nSep" to also handle the "aSuffix"
|
614 | + Fixed the "mRound" default
|
615 |
|
616 | ### 2.0.0-beta.3
|
617 | + fixed nSep option which removes the Currency symbol and thousand separator on focusin
|
618 | + changed the defaults for scaleDivisor, scaleDecimal & scaleSymbol to null
|
619 |
|
620 | ### 2.0.0-beta.2
|
621 | + Modify the scaling options and separate them
|
622 | + aScale - removed
|
623 | + scaleDivisor added
|
624 | + scaleDecimal added
|
625 | + scaleSymbol added
|
626 |
|
627 | ### 2.0.0-beta.0 (released 2016-11-16)
|
628 | + Prepare the code base for future Jasmine tests
|
629 | + Add initial babel support
|
630 | + Add uglify and npm-build-process support
|
631 | + Merge the 2.0 changes into master
|
632 | + Add npm support for building the minified version
|
633 | + Multiple small fixes
|
634 | + Fixed paste event on both context menu and `ctrl-v` // issue #251 special thanks to @rhyek
|
635 | + Fixed tab in key select all and deletion // issue #246
|
636 | + Fixed issue with Vue.js 2.0 // issue #247
|
637 | + Fixed context menu paste event // issue #251
|
638 | + switch from jsLint to jsHint
|
639 | + Fixed tab in key // thanks movalz issue #212
|
640 | + Fixed the cursor position when tabbing in Chrome // thanks Dennis Smith issue #221
|
641 | + Fixed the destroy method // thanks brunoporto & Mabusto issue #225
|
642 | + Fixed the readme file to show correct `$.extend` defaults // thanks gayan85 issue #229
|
643 | + Fixed bug in unSetOnSubmit option to handle non autoNumeric controlled inputs
|
644 | + Fixed bug in `get` method
|
645 | + Mods to the trailing minus sign code
|
646 | + Added UMD support
|
647 | + Modified & improved the shim for throwing the `input` event
|
648 | + Added option `unSetOnSubmit` to unformat input on the submit event
|
649 | + Added option `debug` to turn on and off error being thrown
|
650 | + Added support for arbitrary-precision decimal arithmetic. This was adapted from Big.js https://github.com/MikeMcl/big.js/ Many thanks to Mike
|
651 | + Added support for trailing minus signs
|
652 | + Added rounding methods for currencies with smallest coin being $0.05
|
653 | + Added modified `sNumber` option that selects only numbers ctr & a keys thanks Zayter
|
654 | + Added support for return values to have locale formats
|
655 | + Added debug option to turn off errors
|
656 | + Added option `anDefault` to help ASP.NETR postback errors
|
657 | + Modified the `wEmpty` option
|
658 | + Modified the `init` && `set` methods
|
659 | + General code clean up
|
660 | + Modified the `set`, `getString` & `getArray` methods
|
661 | + Modified the `nBracket` function
|
662 | + Fixed the `update` method when it is called during the `onfocus` event
|
663 | + Fixed the `getString` & `getArray` methods when multiple inputs share the same name - Thanks Retromax
|
664 | + Fixed bug in `ctrl + v` paste event to properly round
|
665 | + Merged a mod that makes the defaults public and overridable - Thanks Peter Boccia
|
666 | + Fixed page reload when the thousand separator is a period `.`
|
667 |
|
668 | ### 1.9.46 (released 2016-09-11)
|
669 | + Fixed tab in key // thanks movalz issue #212
|
670 | + Fixed the cursor position when tabbing in Chrome // thanks Dennis Smith issue #221
|
671 | + Fixed the destroy method // thanks brunoporto & Mabusto issue #225
|
672 | + Fixed the readme file to show correct $.extend defaults // thanks gayan85 issue #229
|
673 |
|
674 | ### 1.9.45 (released 2016-06-13)
|
675 | + Modified the "set" method to handle NaN
|
676 |
|
677 | ### 1.9.44 (released 2016-06-06)
|
678 | + Fixed destroy method
|
679 | + Added Typings support - thanks bcherny
|
680 |
|
681 | ### 1.9.43 (released 2015-12-19)
|
682 | + UMD support
|
683 |
|
684 | ### 1.9.42 (released 2015-11-20)
|
685 | + Fixed bug when pasting using ctrl & v keys
|
686 |
|
687 | ### 1.9.41 (released 2015-11-02)
|
688 | + Fixed bug that allowed two currency symbols - thanks Mic Biert
|
689 |
|
690 | ### 1.9.40 (released 2015-10-25)
|
691 | + Fixed bug when pasting value and the decimal separator is a comma ","
|
692 | + Modified the "destroy" method so that an error is not thrown if the "init" method has not been called previously
|
693 |
|
694 | ### 1.9.39
|
695 | + Fixed 'aForm'option.
|
696 | + Updated the readme file
|
697 |
|
698 | ### 1.9.38
|
699 | + Added / fixed option to address asp.Net WebForm postback.
|
700 | + please see the readme section on default settings & options
|
701 |
|
702 | ### 1.9.37
|
703 | + Added / fixed support for asp.Net WebForm postback.
|
704 | + During postback the default value is re-rendered showing the updated value
|
705 | + Because autoNumeric cannot distinguish between a page re-load and asp.net form postback, the following HTML data attribute is REQUIRED (data-an-default="same value as the value attribute") to prevent errors on postback
|
706 | + Example:
|
707 | ```html
|
708 | <input type="text" id="someID" value="1234.56" data-an-default="1234.56">
|
709 | ```
|
710 |
|
711 | ### 1.9.36
|
712 | + Rewrote the "getString" & "getArray" methods to index successful elements and inputs that are controlled by autoNumeric. This ensures the proper input index is used when replacing the formatted value.
|
713 | + Added support for FireFox for Mac meta key "keycode 224" - Thanks Ney Estrabelli
|
714 |
|
715 | ### 1.9.35
|
716 | + Revert 'set' back to version 1.9.34
|
717 |
|
718 | ### 1.9.34
|
719 | + Modified the 'set', 'getString' & 'getArray' methods
|
720 | + Modified the 'nBracket' function
|
721 | + General code clean up
|
722 |
|
723 | ### 1.9.33
|
724 | + Fixed bug in "ctrl + v" paste event introduced in 1.9.32
|
725 |
|
726 | ### 1.9.32
|
727 | + Fixed bug when the "update" method is called in the "onfocus" event
|
728 | + Fixed the "getString" & "getArray" methods when multiple inputs share the same name - Thanks Retromax
|
729 | + Fixed bug in "ctrl + v" paste event to properly round
|
730 |
|
731 | ### 1.9.31
|
732 | + never officially release
|
733 |
|
734 | ### 1.9.30
|
735 | + Fixed bug introduced 1.9.29 too interested in Ohio State vs. Oregon
|
736 |
|
737 | ### 1.9.29
|
738 | + Fixed bug introduced in 1.9.27
|
739 |
|
740 | ### 1.9.28
|
741 | + Fixed focusout event when the thousand separator is a period "." and only one is present "x.xxx" with not other alpha characters.
|
742 |
|
743 | ### 1.9.27
|
744 | + Merged a mod that makes the defaults public and overridable - Thanks Peter Boccia
|
745 | + Fixed page reload when the thousand separator is a period "."
|
746 |
|
747 | ### 1.9.26
|
748 | + Fixed "getString" & "getArray" methods when multiple forms having some shared named inputs
|
749 |
|
750 | ### 1.9.25
|
751 | + Fixed mRound option "round-half-even"
|
752 | + Modified the "set" method to not throw an error when trying to "set" a null value
|
753 |
|
754 | ### 1.9.24
|
755 | + Changed the case on the supported elements
|
756 | + This was required because jQuery.prop('tagName') returns upper-case on html5 pages and returns lower-case on xhtml pages
|
757 |
|
758 | ### 1.9.23
|
759 | + Merged mod on the "getString" method
|
760 |
|
761 | ### 1.9.22
|
762 | + Fixed a bug when a negative value uses brackets and currency sign on page reload thanks to Allen Dumaine
|
763 | + Additional mods to the "set" method.
|
764 | + Eliminated lastSetValue setting
|
765 |
|
766 | ### 1.9.21
|
767 | + Mod to checkValue function to handle empty string - thanks to jedichenbin.
|
768 | + If CHF rounding is used decimal is automatically set to 2 places
|
769 |
|
770 | ### 1.9.20
|
771 | + Fixed issue for very small numbers - thanks to jedichenbin.
|
772 |
|
773 | ### 1.9.18
|
774 | + Added input type="tel" support.
|
775 | + Added support for Swiss currency rounding to the nearest ".00 or .05"
|
776 | + Fixed bug in Round-Half-Even "Bankers Rounding"
|
777 |
|
778 | ### 1.9.18
|
779 | + Fixed formatting on page load for text elements.
|
780 |
|
781 | ### 1.9.17
|
782 | + Fixed leading zero on page load when option lZero is set to 'keep'.
|
783 |
|
784 | ### 1.9.16
|
785 | + Fixed the checkValue function when vary small numbers in scientific notation are passed via the set method.
|
786 | + Modified the rounding method so zero value is not returned with a negative sign
|
787 |
|
788 | ### 1.9.15
|
789 | + Fixed bug introduced in version 1.9.14
|
790 |
|
791 | ### 1.9.14
|
792 | + Added additional supported tags ('b', 'caption', 'cite', 'code', 'dd', 'del', 'div', 'dfn', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ins', 'kdb', 'label', 'li', 'output', 'p', 'q', 's', 'sample', 'span', 'strong', 'td', 'th', 'u', 'var')
|
793 | + Moved the routine that tests for supported tags
|
794 | + General code clean-up
|
795 |
|
796 | ### 1.9.13
|
797 | + Fixed the "get" method when the input receives focus for a second time.
|
798 |
|
799 | ### 1.9.12
|
800 | + Fixed brackets on page load when the decimal character is a comma.
|
801 |
|
802 | ### 1.9.11
|
803 | + Another mod to the 'set' method.
|
804 |
|
805 | ### 1.9.10
|
806 | + Fixed the 'set' method to handle page reload using the back button.
|
807 |
|
808 | ### 1.9.9
|
809 | + Fixed how non-input tags default value is handled. When the default is an empty string and aSign is not empty the return value is now and empty string.
|
810 | + Modified how default values are handled when the decimal character equals ',' comma. Your default value can now use either a a period '.' or comma ',' as the decimal separator
|
811 | + Modified the caret placement on focusin (tab in). If only the currency sign is visible the caret is placed in the proper location depending on the sign placement (prefix or suffix).
|
812 |
|
813 | ### 1.9.8
|
814 | + Changed bind / unbind to on / off.
|
815 | + added lastSetValue to settings - this saves the unrounded value from the set method - $('selector').data('autoNumeric').lastSetValue; - helpful when you need to change the rounding accuracy
|
816 |
|
817 | ### 1.9.7
|
818 | + Modified /fixed the format default values on page ready.
|
819 | + Fixed the caret position when jumping over the thousand separator with back arrow.
|
820 |
|
821 | ### 1.9.6
|
822 | + Fixed bug introduced in 1.9.3 with shift key.
|
823 | + additional modification to the processKeypress function that automatically inserts a negative sign when vMax less than or equal to 0 and vMin is less than vMax.
|
824 |
|
825 | ### 1.9.5
|
826 | + Modified processKeypress function to automatically insert a negative sign when vMax <=0 and vMin < 0.
|
827 | + Changed the getSting and getArray functions to use decodeURIComponent() instead of unescape() which is depreciated
|
828 |
|
829 | ### 1.9.4
|
830 | + Merged issue #11 - Both getString and getArray were using escaped versions of the name from jQuery's serialization. So this change wraps the name finder with quotes and unescapes the name.Fixed a bug in autoCode that corrects the pasted values and page re-load - Thanks Cory.
|
831 | + Merged issue #12 - If a input is readonly during "init", autocomplete won't work if the input is enabled later. This commit should fix the Problem - Thanks Sven.
|
832 |
|
833 | ### 1.9.3
|
834 | + Fixed a bug in autoCode function that corrects pasted values and page re-load
|
835 | + Added support for "shift" + "insert" paste key combination
|
836 |
|
837 | ### 1.9.2
|
838 | + Modified the "checkValue" function - eliminated redundant code
|
839 | + Modified the "update" method include calling the "getHolder" function which updates the regular expressions
|
840 | + Modified the "getHolder function so the regular expressions are updated
|
841 | + Modified the "set" method to convert value from number to string
|
842 |
|
843 | ### 1.9.1
|
844 | + Modified the checkValue function to handle values as text with the exception of values less than "0.000001 and greater than -1"
|
845 |
|
846 | ### 1.9.0
|
847 | + Fixed a rounding error when the integers were 15 or more digits in length
|
848 | + Added "use strict";
|
849 |
|
850 | ### 1.8.9
|
851 | + Fixed the "get" and "set" methods by moving the settings.oEvent property to ensure the error message would be thrown if the element had not been initialized prior to calling the "get" and "set" methods
|
852 |
|
853 | ### 1.8.8
|
854 | + Fixed the "init" when there is a default and value aForm=true and the aSep and aDec are not the defaults
|
855 |
|
856 | ### 1.8.7
|
857 | + Fixed the "getSting" method - it use to returned an error when no values were entered
|
858 | + Modified the "init" method to better handle default and pre-existing values
|
859 | + Modified the "set" method - removed the routine that checked for values less than .000001 and greater than -1 and placed it in a separate function named checkValue()
|
860 | + Modified the "get" method:
|
861 | + Added a call to the checkValue() function - this corrects returned values example - when the input value was "12." the returned value was "12." - it now returns "12"
|
862 | + When no numeric character is entered the returned value is an empty string "".
|
863 |
|
864 | ### 1.8.6
|
865 | + Removed the error message when calling the 'init' methods multiple times. This was done when using the class selector for the 'init' method and then dynamically adding input(s) it allows you to use the same selector to init autoNumeric. **Please note:** if the input is already been initialized no changes to the option will occur you still need to use the update method to change existing options.
|
866 | + Added support for brackets '[,]', parentheses '(,)', braces '{,}' and '<,>' to the nBracket setting. **Please note:** the following format nBracket: '(,)' that the left and right symbol used to represent negative numbers must be enclosed in quote marks and separated by a comma to function properly.
|
867 |
|
868 | ### 1.8.5
|
869 | + Fixed readonly - this occurred when you toggle the readonly attribute
|
870 |
|
871 | ### 1.8.4
|
872 | + Fixed the getString and getArray methods under jQuery-1.9.1
|
873 |
|
874 | ### 1.8.3
|
875 | + Added input[type=hidden] support - this was done mainly for backward compatibility.
|
876 | + The "get" method now returns a numeric string - this also was done for backward compatibility.
|
877 |
|
878 | ### 1.8.2
|
879 | + Allowed dGroup settings to be passed as a numeric value or text representing a numeric value
|
880 | + Allows input fields without type that defaults to type text - Thanks Mathieu Demont
|
881 |
|
882 | ### 1.8.1
|
883 | + Modified the 'get' method so when a field is blank and the setting wEmpty:'empty' a empty string('') is returned.
|
884 |
|
885 | ### 1.8.0
|
886 | + autoNumeric() 1.8.0 is not compatible with earlier versions but I believe you will find version 1.8.0's new functionality and ease of use worth the effort to convert.
|
887 | + Changed autoNumeric structure to conform to jQuery's recommended plugin development.
|
888 | + Created a single namespace and added multiple methods.
|
889 | + Added HTML 5 data support and eliminated the metadata plugin dependency.
|
890 | + Added support for the following elements: 'DD', 'DT', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'input', 'LABEL', 'P', 'SPAN', 'TD', 'TH'.
|
891 | + Changed the settings loading order to defaults, HTML5 data then options. Now the defaults settings are overridden by HTML5 data and options overrides both defaults & HTML5 data.
|
892 | + Added "lZero" to the settings to control leading zero behavior.
|
893 | + Added "nBracket" to the settings which controls if negative values are display with brackets.
|
894 | + Changed the callback feature to accept functions only.
|
895 | + Improved the 'aForm' behavior that allows values to be automatically formatted on page ready.
|
896 | + Fixed the issue for numbers that are less than 1 and greater than -1 and have six or more decimal places.
|
897 | + Fixed 'crtl' + 'a' (select all) and 'ctrl' + 'c' (copy) combined key events.
|
898 | + Fixed a IE & FF bug on readonly attribute.
|
899 | + General code clean up
|