Skip to content

Commit 6cbef71

Browse files
Updates the documentation with the new options introduced in 4.7.0
1 parent 9ca281c commit 6cbef71

File tree

7 files changed

+77
-19
lines changed

7 files changed

+77
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The official documentation for [AutoNumeric](https://github.com/autoNumeric/autoNumeric/) is stored in this repository.
44

5-
This documentation is replacing the *huge* readme in the official [AutoNumeric repository](https://github.com/autoNumeric/autoNumeric/), and complete the website [http://autonumeric.org](http://autonumeric.org) where additional tools can be found.
5+
This documentation is replacing the previously *huge* readme in the official [AutoNumeric repository](https://github.com/autoNumeric/autoNumeric/), and complete the website [http://autonumeric.org](http://autonumeric.org) where additional tools can be found.
66

77
## Technology
88

docs/About/license.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AutoNumeric is an [MIT](http://opensource.org/licenses/MIT)-licensed open source
44

55
## MIT License
66

7-
Copyright © 2016-2022 Alexandre Bonneau <[email protected]> and contributors<br>
7+
Copyright © 2016-2023 Alexandre Bonneau <[email protected]> and contributors<br>
88
Copyright © 2009-2016 Robert J. Knothe <[email protected]> and contributors
99

1010

docs/Changelog/CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,51 @@
22

33
### v4
44

5+
#### 4.7.0
6+
+ Fixes #719 Feature request: Up and down arrow keys behavior matching standard number input
7+
+ Adds 2 new options to control how the up and down arrow keys behave: `modifyValueOnUpDownArrow` and `upDownStep`
8+
9+
#### 4.6.3
10+
+ Fixes #721 AutoNumeric.set() breaks internal state when string-value has leading or trailing whitespace
11+
+ Fixes all the remaining end-to-end tests with the latest Webdriver.io version
12+
+ Removes the remnants of PhantomJS hacks (#384)
13+
+ Updates the Travis CI configuration
14+
+ Fixes the caret positioning in some specific cases
15+
+ Fixes the lint issues in the wdio config file
16+
+ Fixes the webpack production config to correctly generate gzipped dist files
17+
18+
#### 4.6.2
19+
+ Fixes issue #757 Converted scientific numbers returns NaN when using `formArrayNumericString()`
20+
+ Fixes warning messages in the IDE
21+
22+
#### 4.6.1
23+
+ Updates all the dependencies
24+
+ Removes the PhantomJS dependency in favor of Puppeteer
25+
+ Fixes and cleans the Karma configuration files to support v6.4.1
26+
+ Fixes and cleans the Webpack configuration files to support v5.75.0
27+
+ Fixes the failing unit tests on the `validate()` function for the `allowDecimalPadding` option
28+
+ Updates the Webdriverio configuration to v8
29+
+ Updates the Webdriver end-to-end tests to v8, i.e. removing the `@wdio/sync` package in favor of using async/await everywhere, and updating all the `keys()` calls to use the Webdriver `Key` object, and arrays of individual characters
30+
+ Adds unit tests for feature request #741
31+
+ Completes the `validate()` function with additional tests for the new `allowDecimalPadding` option as a number
32+
+ Fixes #761 Undo and redo actions are done twice, on Z and Control KeyUp events
33+
+ Fixes missing variable update in #739 (`this.onGoingRedo`)
34+
+ Fixes the warning message when a faulty `styleRules` callback is passed as a parameter
35+
+ Fixes typos and grammar in comments
36+
+ Fixes #734 Fire change event onBlur only if number is changed (#735)
37+
+ Fixes #753 Correct invalid JS imports
38+
+ Fixes #758 Adding missing predefined options to typescript interface file
39+
+ Update the readme with the new documentation website
40+
+ Fixes #739 Add CTRL+Y shortcut for redo
41+
+ Fixes the currency symbol for Brazilian real
42+
+ Fixes #697 Currency can be deleted (#725)
43+
+ Updates the README related to PR #742
44+
+ Fixes #741 + Ability to set a numeric allowDecimalPadding (#742)
45+
+ Adds default export to modules (#747)
46+
+ Fixes #737 Undo/redo not firing input event
47+
+ Fixes #684 Caret always set far right when deleting or inserting numbers using $ (#716)
48+
+ Fixes unit tests following the changes in `v4.6.0`
49+
550
#### 4.6.0
651
+ Adds a new option `invalidClass`, which default to `an-invalid`, that defines the CSS class name to use when a contenteditable-enabled element value is invalid
752
+ Adds a new option value `'invalid'` for the `overrideMinMaxLimits` option, that will allow users to enter out-of-bound numbers

docs/Documentation/configuration options.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Want to know more? Check out the [examples](http://autonumeric.org/examples).
99

1010
Below are listed in alphabetical order the options that you can pass an AutoNumeric element, in order to make it change its behavior or formatting specifications.
1111

12-
| Option | Description | Default Value |
13-
| :---------------- | :----------- | :----------- |
14-
| `allowDecimalPadding` | Allow padding the decimal places with zeros. If set to `'floats'`, padding is only done when there are some decimals. If set to an integer, padding will use that number for adding the zeros. | `true` |
12+
| Option | Description | Default Value |
13+
| :---------------- | :----------- |:--------------------|
14+
| `allowDecimalPadding` | Allow padding the decimal places with zeros. If set to `'floats'`, padding is only done when there are some decimals (up to the number of decimal places from the `decimalPlaces` variable). If set to an integer, padding will use that number for adding the zeros. If set to `true` it will always pad the decimal places with zeroes, and never if set to `false`. | `true` |
1515
| `alwaysAllowDecimalCharacter` | Defines if the decimal character or decimal character alternative should be accepted when there is already a decimal character shown in the element. | `false` |
1616
| `caretPositionOnFocus` | Determine where should be positioned the caret on focus | `null` |
1717
| `createLocalList` | Determine if a local list of AutoNumeric objects must be kept when initializing the elements and others | `true` |
@@ -25,7 +25,7 @@ Below are listed in alphabetical order the options that you can pass an AutoNume
2525
| `decimalPlacesShownOnFocus` | The number of decimal places to show when *focused* | `null` |
2626
| `defaultValueOverride` | Helper option for the ASP.NET-specific postback issue | `null` |
2727
| `digitalGroupSpacing` | Digital grouping for the thousand separator | `'3'` |
28-
| `digitGroupSeparator` | Thousand separator character | `','` |
28+
| `digitGroupSeparator` | Thousand separator character | `','` |
2929
| `divisorWhenUnfocused` | Defines the number that will divide the current value shown when unfocused | `null` |
3030
| `emptyInputBehavior` | Defines what to display when the input value is empty (possible options are `null`, `focus`, `press`, `always`, `min`, `max`, `zero`, number, or a string representing a number) | `'focus'` |
3131
| `eventBubbles` | Defines if the custom and native events triggered by AutoNumeric should bubble up or not | `true` |
@@ -38,6 +38,7 @@ Below are listed in alphabetical order the options that you can pass an AutoNume
3838
| `leadingZero` | Controls the leading zero behavior (possible options are `allow`, `deny` and `keep`) | `'deny'` |
3939
| `maximumValue` | The maximum value that can be entered (10 trillions by default) | `'10000000000000'` |
4040
| `minimumValue` | The minimum value that can be entered (-10 trillions by default) | `'-10000000000000'` |
41+
| `modifyValueOnUpDownArrow` | Determine if the element value can be incremented / decremented with the up and down arrow keys. The keys behavior is modified with the `upDownStep` option. | `true` |
4142
| `modifyValueOnWheel` | Determine if the element value can be incremented / decremented with the mouse wheel. The wheel behavior is modified with the `wheelStep` option. | `true` |
4243
| `negativeBracketsTypeOnBlur` | Adds brackets `[]`, parenthesis `()`, curly braces `{}`, chevrons `<>`, angle brackets `〈〉`, Japanese quotation marks `「」`, half brackets `⸤⸥`, white square brackets `⟦⟧`, quotation marks `‹›` or guillemets `«»` on negative values when unfocused. The value must be formatted like `'<leftBracket>,<rightBracket>'`. | `null` |
4344
| `negativePositiveSignPlacement` | Placement of negative/positive sign relative to the currency symbol (possible options are `l` (left), `r` (right), `p` (prefix) and `s` (suffix)) | `null` |
@@ -47,12 +48,12 @@ Below are listed in alphabetical order the options that you can pass an AutoNume
4748
| `outputFormat` | Defines the localized output format of the `getLocalized`, `form*`, `formArray*` and `formJson*` methods | `null` |
4849
| `overrideMinMaxLimits` | Override minimum and maximum limits (possible options are `ceiling`, `floor`, `ignore` and `invalid`) | `null` |
4950
| `positiveSignCharacter` | Defines the positive sign character to use (Note: It's only shown if `showPositiveSign` is set to `true`) | `'+'` |
50-
| `rawValueDivisor` | Define the number that will divide the formatted value into the raw value (ie. when displaying `'1.23%'`, the raw value kept is `0.0123` if `rawValueDivisor` is set to `100`) | `null` |
51+
| `rawValueDivisor` | Define the number that will divide the formatted value into the raw value (i.e. when displaying `'1.23%'`, the raw value kept is `0.0123` if `rawValueDivisor` is set to `100`) | `null` |
5152
| `readOnly` | Defines if the element (`<input>` or another allowed html tag) should be set as read-only on initialization | `false` |
5253
| `roundingMethod` | Method used for rounding. The possible options are:<br>`S` (Round-Half-Up Symmetric (default)),<br>`A` (Round-Half-Up Asymmetric),<br>`s` (Round-Half-Down Symmetric (lower case s)),<br>`a` (Round-Half-Down Asymmetric (lower case a)),<br>`B` (Round-Half-Even 'Bankers Rounding'),<br>`U` (Round Up 'Round-Away-From-Zero'),<br>`D` (Round Down 'Round-Toward-Zero' - same as truncate),<br>`C` (Round to Ceiling 'Toward Positive Infinity'),<br>`F` (Round to Floor 'Toward Negative Infinity'),<br>`N05` (Rounds to the nearest .05 (same as `'CHF'` used in v1.9.* and still valid)),<br>`U05` (Rounds up to next .05),<br>`D05` (Rounds down to next .05) | `'S'` |
5354
| `saveValueToSessionStorage` | Allow the `decimalPlacesShownOnFocus` value to be saved into session storage | `false` |
5455
| `selectNumberOnly` | Determine if the 'Select All' keyboard command will select the complete input text content (including the currency symbol and suffix text), or only the input numeric value | `false` |
55-
| `selectOnFocus` | Defines if the element value should be selected on focus. That selection is dependant on the `selectNumberOnly` option value. | `true` |
56+
| `selectOnFocus` | Defines if the element value should be selected on focus. That selection is dependent on the `selectNumberOnly` option value. | `true` |
5657
| `serializeSpaces` | Defines how the serialize functions should treat spaces when serializing (convert them to `'%20'` or `'+'`) | `'+'` |
5758
| `showOnlyNumbersOnFocus` | Remove the thousand separator, currency symbol and suffix on focus | `false` |
5859
| `showPositiveSign` | Allow the positive sign symbol `+` to be displayed for positive numbers | `false` |
@@ -62,7 +63,8 @@ Below are listed in alphabetical order the options that you can pass an AutoNume
6263
| `symbolWhenUnfocused` | Symbol placed as a suffix when unfocused. This is used in combination with the `divisorWhenUnfocused` option. | `null` |
6364
| `unformatOnHover` | Defines if the element value should be unformatted when the user hover his mouse over it while holding the `Alt` key | `true` |
6465
| `unformatOnSubmit` | Removes formatting on submit event | `false` |
66+
| `upDownStep` | Used in conjonction with the `modifyValueOnUpDownArrow` option, this allows to either define a *fixed* step (i.e. `1000`), or a *progressive* one that is calculated based on the size of the current value | `'1'` |
6567
| `valuesToStrings` | Provide a way for automatically and transparently replacing the formatted value with a pre-defined string, when the raw value is equal to a specific value.<br>For instance when using `{ 0: '-' }`, the hyphen `'-'` is displayed when the `rawValue` is equal to `0`. Multiple 'replacements' can be defined. | `null` |
6668
| `watchExternalChanges` | Defines if the AutoNumeric element should watch (and format) external changes made without using `.set()`. This is set to `false` by default to prevent infinite loops when used with third party frameworks that relies on the `'autoNumeric:rawValueModified'` events being sent. | `false` |
6769
| `wheelOn` | Used in conjonction with the `modifyValueOnWheel` option, defines when the wheel event will increment or decrement the element value, either when the element is focused, or hovered | `'focus'` |
68-
| `wheelStep` | Used in conjonction with the `modifyValueOnWheel` option, this allow to either define a *fixed* step (ie. `1000`), or a *progressive* one that is calculated based on the size of the current value | `'progressive'` |
70+
| `wheelStep` | Used in conjonction with the `modifyValueOnWheel` option, this allows to either define a *fixed* step (i.e. `1000`), or a *progressive* one that is calculated based on the size of the current value | `'progressive'` |

docs/Documentation/demo.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### Demo
2+
13
If you want to see AutoNumeric in action and try it yourself, you can either play with the field on the [AutoNumeric homepage](http://autonumeric.org), or check the [live demo](https://codepen.io/AnotherLinuxUser/pen/JyBGpz?editors=1010).
24

3-
Altenatively, you can also check the [vue-autonumeric demo](https://codepen.io/AnotherLinuxUser/pen/pWgOrZ).
5+
You can also take a look at the [predefined options examples](http://autonumeric.org/examples) (Predefined language options, Predefined common options, Predefined common monetary options, Predefined percentage options and Predefined style rules).
6+
7+
### Tools
8+
9+
Finally, you can use the [configuration generator tool](http://autonumeric.org/configurator) to generate your configuration options objects, while being able to see with a live preview the effect of each chosen options.
10+
11+
### Related projects
12+
13+
Alternatively, you can also check the [vue-autonumeric demo](https://codepen.io/AnotherLinuxUser/pen/pWgOrZ).

docs/index.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,31 @@ The mobile Android Chrome browser is partially supported.
6262
- The settings can easily be changed at *any* time using the `update` method or via a callback
6363
- AutoNumeric supports `input` elements as well as most text elements with the `contenteditable` attribute, allowing you to place formatted numbers and currencies on just about any part of your pages
6464
- AutoNumeric elements *can be linked together* allowing you to perform one action on multiple elements at once
65-
- 8 pre-defined [currency options](Documentation/predefined options.md#predefined-language-options) as well as 33 [common options](Documentation/predefined options.md#predefined-common-options) allows you to directly use AutoNumeric by skipping the option configuration step
65+
- 8 [pre-defined currency options](Documentation/predefined options.md#predefined-language-options) as well as 33 [pre-defined common options](Documentation/predefined options.md#predefined-common-options) allows you to directly use AutoNumeric by skipping the option configuration step
6666
- 26 built-in [methods](Documentation/methods.md) gives you the flexibility needed to use AutoNumeric to its full potential
67-
- 22 [global methods](Documentation/instantiated methods.md#perform-actions-globally-on-a-shared-init-list-of-autonumeric-elements) that allows to control sets of AutoNumeric-managed elements at once
67+
- 22 [global methods](Documentation/instantiated methods.md#perform-actions-globally-on-a-shared-init-list-of-autonumeric-elements) that allows to control *sets* of AutoNumeric-managed elements at once
6868
- 21 additional [methods](Documentation/instantiated methods.md#form-functions) specialized for managing form management and submission
6969
- A [formula mode](Documentation/formula mode.md) that allows to quickly enter and evaluate math expressions inside the element
70-
- 17 [static functions](Documentation/static methods.md) provided by the `AutoNumeric` class
71-
- And more than 50 [options](Documentation/configuration options.md) allowing you to precisely customize your currency format and behavior
70+
- 17 [static functions](Documentation/static methods.md) provided by the `AutoNumeric` class, which can be used in Web Workers
71+
- And more than 50 [options](Documentation/configuration options.md) allowing you to precisely customize your number and currency format and behavior
7272

7373
With that said, AutoNumeric supports most international numeric formats and currencies including those used in Europe, Asia, and North and South America.
7474

7575
## Try AutoNumeric!
7676

77-
If you want to try AutoNumeric, please check the [demo](Documentation/demo.md) page.
77+
If you want to try AutoNumeric, please check the [demo](Documentation/demo.md) page.<br>
78+
There, you'll also have links to the additional AutoNumeric tools.
7879

7980
## Which version should I use?
8081

81-
The latest stable branch is always on `master`. Currently this is version [4.2.*](https://github.com/autoNumeric/autoNumeric/tree/master).
82+
The latest stable branch is always on `master`. Currently this is version [4.6.*](https://github.com/autoNumeric/autoNumeric/tree/master).
8283

83-
However most of the development in done on the `next` [branch](https://github.com/autoNumeric/autoNumeric/tree/next), with `master` being updated sparsely.
84+
However, most of the development in done on the `next` [branch](https://github.com/autoNumeric/autoNumeric/tree/next), with `master` being updated sparsely.
8485

8586
If you want to try the new features, you can check out the latest development version in the `next` [branch](https://github.com/autoNumeric/autoNumeric/tree/next). That branch can see changes in the API (check the [semver](http://semver.org/)), however it's still very stable and bug-free (as far as we know) since it's always fully tested for regressions.
8687

8788
!!! tip
88-
`next` is the preferred branch to use in production. Use `master` only if you do not need fixes quickly.
89+
`next` is the preferred branch to use in production. Use `master` only if you do not need fixes quickly and are prepared to wait a few years between releases.
8990

9091
### Older versions (v1.9 and v2)
9192

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ copyright: 'Made with ❤ in France'
1616
# Main navigation
1717
nav:
1818
- User documentation:
19-
- AutoNumeric documentation: index.md
19+
- AutoNumeric.js documentation: index.md
2020
- Try AutoNumeric: Documentation/demo.md
2121
- Getting Started:
2222
- Installation: Documentation/installation.md

0 commit comments

Comments
 (0)