@tagplus/components 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "email": "bruno@tagplus.com.br"
9
9
  }
10
10
  ],
11
- "version": "4.3.0",
11
+ "version": "4.4.0",
12
12
  "main": "./dist/tp.common.js",
13
13
  "directories": {
14
14
  "lib": "src/lib"
@@ -40,11 +40,6 @@ function unformat (input, precision = defaults.precision) {
40
40
  function formatMoney (input, toString = false, locale = defaults, customPrecision = false) {
41
41
  let inputString = (`${input}`)
42
42
 
43
- // Caso componente receba props de precisão customizada (ex.: tp-money com precisão diferente da locale padrão).
44
- if (customPrecision) {
45
- locale.number.precision = customPrecision
46
- }
47
-
48
43
  // Impede de digitar . ou , porque o formatador já adiciona
49
44
  if ((inputString.slice(-1).match(/[.,]/))) {
50
45
  inputString = inputString.substring(0, inputString.length - 1)
@@ -57,6 +52,7 @@ function formatMoney (input, toString = false, locale = defaults, customPrecisio
57
52
  }
58
53
 
59
54
  const precision = customPrecision || locale.number.precision
55
+
60
56
  const numbers = onlyNumbers(input, precision)
61
57
  const currency = numbersToCurrency(numbers, precision)
62
58