- Aug 26, 2017
-
-
Alexandre Bonneau authored
Fix issue #488 Add a new event hook `autoNumeric:rawValueModified` that will be sent only when the `rawValue` is modified Fix issue #485 Add more details to the `'autoNumeric:formatted'` event payload Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Aug 22, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #480 On Firefox, the end-to-end tests fails when trying to send the minus `'-'` character. Also fix the selenium tests where entering the hyphen (`'-'`) character was not correctly accepted under Firefox. This was due to the fact that the wrong keyCode `173` is sent instead of `189` like in all the other browsers for that character. Fix issue #481 When the caret is on the far right and the negative sign too, entering `'+'` or `'-'` does not toggle the positive state, and only move the caret from one character to the left. Fix issue #482 Pasting a positive value while selecting the entire content of an element that has a negative value result in an error. Update the 'Options' chapter in the documentation to add some details on a few options. Simplify `_checkPaste()` so that it's not processed any more times if the element has already been formatted. Fix the range check so that when the `rawValue` is allowed to be `null` and is effectively `null`, the min/max limits are ignored. Modify how `this.formatted` is used so it tracks if the element value has been formatted already. If that's the case, prevent further format calculations. This is a start and `this.formatted` usage should be reviewed in depth. Fix issue #484 Pasting an invalid string into either a selection or at the caret position modify the element value. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Aug 17, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Aug 11, 2017
-
-
Alexandre Bonneau authored
Fix issue #450 Add the `valuesToStrings` option to allow displaying a pre-defined string when the `rawValue` equal a specific value Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
-
- Jul 28, 2017
-
-
Alexandre Bonneau authored
Fix some eslint errors discovered by the updated eslint version. Update the authors header and file. Update the homepage link to the github page, since the old website documentation is outdated. A link to the old documentation is present on the github page. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #452 Add a new `rawValueDivisor` option to display a formatted value different than the raw value. This allows for instance to display percentages like `'1.23%'`, while keeping the `rawValue` `0.0123` 'unmultiplied', if `rawValueDivisor` is set to `100`. Merge the `blur` event listeners into one. Add the `this.isWheelEvent`, `this.isDropEvent` and `this.isEditing` attributes to track the `wheel` and `drop` events, as well as when the user is manually editing the element value. Modify `_setRawValue()` to divide the `rawValue` if `rawValueDivisor` is set. Fix the validation test for the `scaleDivisor` option where it did not check that it should not be equal to `0`. Fix the validation test for the `allowDecimalPadding` when `decimalPlacesShownOnBlur` or `decimalPlacesShownOnFocus` is set. Add a validation test for `divisorWhenUnfocused` so that it throws if it's set to `1`. Modify the validation test so that setting `divisorWhenUnfocused` to `1` will throw. Modify `_trimLeadingAndTrailingZeros()` so that it manages `null` values correctly (ie. it returns `null` instead of `'0'` if passed `null`). Fix the error shown when blurring an input that accept a `null` value. Modify the pre-defined options `percentage*` so that the `rawValueDivisor` is set to `100`. Rename the `divisorWhenUnfocused` option value from `doNotActivateTheScalingOption` to `none`. Fix `getNumericString()` so that it returns `null` when the `rawValue` is `null`. Separate the `_calculateDecimalPlaces()` function into two `_calculateDecimalPlacesOnInit()` and `_calculateDecimalPlacesOnUpdate()`. The callbacks found in the `settings` object are now run before modifying the `negativePositiveSignPlacement` option. Modify how the settings are updated when the user pass the `decimalPlaces` option. Before, this was overriding any other `decimalPlaces*` options passed in the same object. Now, the `decimalPlaces` value is only used if the other `decimalPlaces*` options are not already set. Moreover, the `decimalPlacesRawValue` option is now overwritten by the other `decimalPlaces*` options defined in the same option object, if their values are higher. Modify the behavior of the `wheelStep` 'progressive' mode so that values between ]-1;-1[ are treated specially, by allowing the wheel event to modify the decimal places. The precision used for the `step` depends on the number of decimal places used for the `rawValue`. Also, numbers between 1 and 9 (included) now use a step of `1`, instead of `10` like before. Set the version of Webpack to `1.14.0`, instead of `latest`, in order to prevent potential incompatibility problems. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jul 25, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jul 21, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #461 Fixed problem on Android Chrome browsers when a currency symbol is used
-
Alexandre Bonneau authored
Remove moving the caret on a `digitGroupSeparator` key event. Reformat the code and comment.
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #388 autoNumeric does not work with Browserify
-
Ivan Hayes authored
-
Alexandre Bonneau authored
Uncomment more end-to-end tests that now pass due to the upgrade of the supported Firefox version (52) Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
This prevent polluting the settings object. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jul 20, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #454 Rewrite how the number of decimal places for the formatted and the raw values are set If you relied of the number of decimals in `minimumValue` or `maximumValue` to define how many decimal places should be shown on the formatted value, or kept as the precision in the `rawValue`, you now need to explicitly define how many decimal places your want, whatever number of decimal places `minimumValue` and `maximumValue` have. To do so, you now need to define at least the `decimalPlaces` option. If you want, you can also separately define `decimalPlacesRawValue`, `decimalPlacesShownOnBlur` and `decimalPlacesShownOnFocus`. For more details, read on. Rename `scaleDecimalPlaces` to `decimalPlacesShownOnBlur`. Rename `scaleDivisor` to `divisorWhenUnfocused`. Rename `scaleSymbol` to `symbolWhenUnfocused`. Rename the `decimalPlacesShownOnBlur.doNotChangeDecimalPlaces` to `decimalPlacesShownOnBlur.useDefault` to be coherent with the other `decimalPlaces*` options. Remove the `decimalPlacesOverride` option in favor of explicit `decimalPlaces`, `decimalPlacesShownOnBlur` and `decimalPlacesShownOnFocus` ones. Add a warning message if the old `mDec` option is used (which was the equivalent of `decimalPlacesOverride`). Add a `decimalPlacesRawValue` option that define the precision the user wants to keep (in the `rawValue`). Remove the need for saving `decimalPlacesOverride` to temporary change it in `set()`. Create 3 different rounding functions that replace the `_roundValue()` calls: `_roundFormattedValueShownOnFocus`, `_roundFormattedValueShownOnBlur` and `_roundRawValue`. This way we are more explicit in what the code is doing. Modify `_setRawValue()` so that it only save the given raw value if it's different than the current one (keeping the history table clean). Use template strings instead of concatenation in `_addGroupSeparators()`, `_roundValue()` and `_prepareValueForRounding()` to prevent possible wrong typecasts. Fix the error shown when hovering an input whose value has been set to `null` (a `toString()` was attempted on the `null` value in the `_roundValue()` method). Fix the incoherent variable name `inputValueHasADot` in `_roundValue()` to better reflect what data it holds, ie. `inputValueHasNoDot`. Fix typos in the `set()` warning messages. Add a warning message when try to set a value that results in `NaN`. Simplify the '_onFocusInAndMouseEnter` and `_onFocusOutAndMouseLeave` event handlers. Update the tests with the new changes. Modify how decimal places are set. Before you needed to add that many decimals to the `minimumValue` or `maximumValue`, and that maximum number of decimal place was used everywhere (except if you also defined `decimalPlacesOverride`, `decimalPlacesShownOnFocus` or `scaleDecimalPlaces`). Now you need to explicitely define the number of decimal places using the `decimalPlaces` option. If only `decimalPlaces` is defined, then the other `decimalPlaces*` options `decimalPlacesRawValue`, `decimalPlacesShownOnBlur` and `decimalPlacesShownOnFocus` are calculated from it. This way, you can now define clearly how many decimal places needs to be shown when focused/unfocused, and as the raw value precision. Note: updating the `decimalPlaces` will overwrite any `decimalPlaces*` option previously set. Remove the `_maximumVMinAndVMaxDecimalLength()` since we do not set the number of decimal places this way. Remove the `_correctDecimalPlacesOverrideOption()` function since `decimalPlacesOverride` is not used anymore. Add a `_calculateDecimalPlaces()` static method that calculate the `decimalPlaces*` option value based on `decimalPlaces` and the `decimalPlaces*` ones. Modify how updating the settings works ; before, all modifications to the settings were directly accepted and stored, then we immediately tried to `set()` back the current value with those new settings. This could lead to an object state where the object value would be out of the minimum and maximum value range, ie. we would accept the range modification, then immediately throw an error since the current value would then be out of range. For instance, if `minimumValue` equal `0`, `maximumValue` equal `100` and the current element value equal `50`, trying to change the `minimumValue` to `75` will fail, and the `minimumValue` will be reverted back to`0`. The new behavior is leaner ; if the new settings do not pass the `validate()` method or the following `set()` call fails, then the settings are reverted to the previous valid ones. In `_setValueParts()`, set the `rawValue` and the formatted element value separately, since they can have different decimal places. For instance we could imagine keeping 3 decimal places for the `rawValue`, while only 2 is shown. I then need to make sure we keep that third decimal place information into the `rawValue`, instead of trimming it like it was done before. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jul 04, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre@crediz.fr>
-
- Jun 26, 2017
-
-
Ruslan Isay authored
-
- Jun 23, 2017
-
-
Ruslan Isay authored
-
- Jun 09, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix a rare bug when `scaleSymbol` is a castable to a Number, and would be added to the formatted value, instead of concatenated. Remove an unneeded temporary variable in `set()`. Add more details in some JSDoc. Fix `validate()` so that it throws an error early if `scaleDivisor` is wrongly set to `0`. Fix `_trimLeadingAndTrailingZeros()` so that it correctly handles the `null` value. Fix `_onFocusInAndMouseEnter()` so that the `decimalPlacesShownOnFocus` setting is correctly cast to a Number. Fix `_onFocusOutAndMouseLeave()` so that the `null` value is correctly handle. Also fix the error message shown when the `rawValue` is not stored as a string. Simplify a ternary condition into a simple `if` one. Hardcode the `isFocused` state to `false` when calling `_addGroupSeparators()` in `_onFocusOutAndMouseLeave()` so that it does not rely on the order where `this.isFocused` is set back to `false`. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jun 05, 2017
-
-
Alexandre Bonneau authored
Fix an issue related to issue #447 when the focus out action produce an error when the input raw value is set to `null` When a `mouseleave` or `blur` event was created on an input having a `rawValue` of `null`, an error was thrown due to the fact some functions were called on `rawValue`, and they expected it to be a string. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
This commit made the `AutoNumericEnum.fromCharCodeKeyCode` array read-only, preventing populating it after it was created. This fixes the introduced by commit b5c69941 (Set the read-only mode on the default settings, enumerations, events, options and pre-defined options objects). Transform `AutoNumericEnum.fromCharCodeKeyCode` from an Array to an Object. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jun 03, 2017
-
-
Alexandre Bonneau authored
Fix the initialization method to accepts arrays of options object/pre-defined options when using an initial value. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jun 02, 2017
-
-
Alexandre Bonneau authored
Set the read-only mode on the default settings, enumerations, events, options and pre-defined options objects In order to prevent any unwanted errors, the pre-defined options, enumerations, events, options and default settings objects are now in read-only mode. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Allow passing an array of options objects or pre-defined option names to the static `format` and `unformat` methods The latter options in the array will overwrite the previous ones. The array can contains either option objects, or pre-defined option names as a string (ie. `'euroPos'`). Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Jun 01, 2017
-
-
Alexandre Bonneau authored
Allow initializing an AutoNumeric element with an array of options objects or pre-defined option names The latter options in the array will overwrite the previous ones. The array can contains either option objects, or pre-defined option names as a string (ie. `'euroPos'`). Both the initialization methods `new AutoNumeric()` and `AutoNumeric.multiple()` support using arrays of options. 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. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- May 31, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- May 29, 2017
-
-
Alexandre Bonneau authored
Fix issue #449 `AutoNumeric.unformat()` only removes the first instance of `settings.digitGroupSeparator` Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- May 28, 2017
-
-
Alexandre Bonneau authored
In `_saveValueToPersistentStorage()` to effectively save to persistent storage, in `_getValueFromPersistentStorage()` to retrieve the data, and finally in `_removeValueFromPersistentStorage` to delete the data from that storage. A new attribute `this.storageNamePrefix` can now be used to modify the raw value storage name variable prefix. It currently defaults to `'AUTO_'`. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- May 27, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
The callback is then executed on the `get*` method result, or the `global.get*` method array of result. The callback is passed the result of the `get*` functions as its first argument, and the current AutoNumeric object as its second. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-