da-js 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 297d35e3613edee0251be3530d2d5d5d22fe2d94a87d39b0e074a5321799fe28
4
- data.tar.gz: 685474146d93ba5bc47c580e266808aae53d00e4ddfbc7c9074f96e14af95c12
3
+ metadata.gz: 59c2c4c4ac669f348d4b9df689d9127f6bc912b53159b1bf6f9145e77e425d62
4
+ data.tar.gz: 18536a16727126222438c61cad7332215e6427accee891ccf36e603038ba3f2c
5
5
  SHA512:
6
- metadata.gz: 6e11b743b1a5ce9e4ad29e05e7500d6816137b48563448c0e8ca98ba195ef68dbf149173ef026518e3128ac7e6b83543a23994bd605b577266758cfd3fde714a
7
- data.tar.gz: 5668570bda4bde3f9e1bcb522c0d2e4c9a97669c89cb344f3ca0b95d9094937c89cb68850be37323e992c7089995ead6ea0bc0404bb41c058dd843d716c2ec17
6
+ metadata.gz: 664231e487baff6a99ba485c347949d865526ed0e47749e011328651b12a240df75dad680e223b1581f16e5ba7e0ea3bd37e3292b381b6c2a0882c030bcd519b
7
+ data.tar.gz: b3eb23fbc7436ba2c6fa9ab51461ce128e29f14ec7a2b00ed476dfd46add405c89d0b874624b4f960afb1d0573428faca8732ebb5197fdd7ea6ac97ca1773c39
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 1.4
2
+ ### Numeric Value
3
+ * New option `ignoreTrailingStrings` (default: `false`).
4
+
1
5
  ## Version 1.3
2
6
  ### Conditional Visibility
3
7
  * After visibility has been recalculated for all elememtn, a `updated.conditionalVisibility` event is triggered.
@@ -5,6 +5,7 @@
5
5
  #
6
6
  # Options:
7
7
  # ignoreCurrencySign: If true, values with leading currency signs (€, $) are considered numeric and parsed correctly.
8
+ # ignoreTrailingStrings: If true, values with trailing strings are considered numeric and parsed correctly.
8
9
  # nullOnError: If true, null is returned (instead of 0) if the value is not numeric.
9
10
 
10
11
  $.fn.numericValue = (options = {}) ->
@@ -20,6 +21,7 @@ $.fn.numericValue = (options = {}) ->
20
21
  val = if $this.is(":input") then $this.val() else $this.text()
21
22
  val = delocalize(val, locale)
22
23
  val = val.replace(/^\s*[€$]\s*/, "") if options.ignoreCurrencySign
24
+ val = val.replace(/[^.\d]+$/, "") if options.ignoreTrailingStrings
23
25
  if $.isNumeric(val)
24
26
  parseFloat(val)
25
27
  else
data/lib/da-js/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Da
2
2
  module Js
3
- VERSION = "1.3".freeze
3
+ VERSION = "1.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da-js
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Daschek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-11 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties