Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hesto2/autonumeric

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hesto2/autonumeric - npm Package Versions

4.6.0

Diff

Changelog

Source

4.6.0

  • 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
  • Adds a new option value 'invalid' for the overrideMinMaxLimits option, that will allow users to enter out-of-bound numbers
  • Fixes #543 Allow users to enter out-of-bound numbers, outside of the minimumValue and maximumValue range
    • This allows users to type temporary invalid numbers when the minimumValue is superior to 0, or the maximumValue is inferior to 0
    • While in this out-of-bound state, the element validity status is set to invalid
    • Users can then target the CSS :invalid and/or :valid state as they wish to display a visual feedback as needed
    • Do note that contenteditable-enabled elements cannot have a validity state set, so AutoNumeric instead sets by default the an-invalid CSS class on such 'invalid' elements
    • Whenever the user type an invalid number (out of range), the new 'autoNumeric:invalidValue' event is sent. When the value is corrected, the new 'autoNumeric:correctedValue' event is sent.
      • Beware; To reduce complexity, the 'autoNumeric:invalidValue' event as well as the 'autoNumeric:minExceeded' or 'autoNumeric:maxExceeded' events are now sent up to three times for a single input; on keypress, keyup and blur
  • From now on, whenever the user sets a minimumValue higher than 0, or a maximumValue lower than 0, a warning will be displayed in the console telling him to perhaps use the overrideMinMaxLimits invalid option. For information, the overrideMinMaxLimits doNotOverride is still the default behavior.
  • Simplify the min and max range tests with the new private _isWithinRangeWithOverrideOption() function
  • Fixes the bug where you could always clear the input even if the limit were preventing you to do so (the last valid value was then set back on blur). Now AutoNumeric correctly prevents you to clear the input if the resulting value is out-of-bound.
  • Fixes #676 36 errors in index.d.ts when using with typescript
    • TypeScript users should now remove the declare module 'autonumeric'; line from their script (cf. PR #677)
  • Removes node 6 from the CI tests (cf. PR #678)
  • Fixes the detection of wheel events when using a touchpad/trackball (cf. PR #672)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc