@tagplus/components 4.7.8 → 4.7.10
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/dist/tp.common.js +1 -1
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +1 -1
- package/dist/tp.umd.js +1 -1
- package/dist/tp.umd.js.map +1 -1
- package/dist/tp.umd.min.js +1 -1
- package/dist/tp.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Autosuggest/Autosuggest.vue +9 -4
- package/src/utils/currency.js +1 -27
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"email": "bruno@tagplus.com.br"
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
|
-
"version": "4.7.
|
|
11
|
+
"version": "4.7.10",
|
|
12
12
|
"main": "./dist/tp.common.js",
|
|
13
13
|
"directories": {
|
|
14
14
|
"lib": "src/lib"
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"husky": "^8.0.1",
|
|
82
82
|
"jest": "^27.1.0",
|
|
83
83
|
"lint-staged": "^13.2.2",
|
|
84
|
+
"sass": "^1.63.4",
|
|
84
85
|
"nodemon": "^2.0.19",
|
|
85
86
|
"prettier": "^2.7.1",
|
|
86
|
-
"sass": "^1.63.4",
|
|
87
87
|
"sass-loader": "^13.0.2",
|
|
88
88
|
"vue-template-compiler": "^2.7.10",
|
|
89
89
|
"webpack": "^5.74.0"
|
|
@@ -519,10 +519,15 @@ export default {
|
|
|
519
519
|
|
|
520
520
|
for (let i = 0; i <= this.cachedOptions.length - 1; i++) {
|
|
521
521
|
const cachedOption = this.cachedOptions[i]
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
522
|
+
let isEqual = false
|
|
523
|
+
if (isObject) {
|
|
524
|
+
isEqual = getValueByPath(cachedOption.value, this.valueKey) === getValueByPath(value, this.valueKey)
|
|
525
|
+
} else {
|
|
526
|
+
isEqual = cachedOption.value === value
|
|
527
|
+
if (initialLabel) {
|
|
528
|
+
cachedOption.label = initialLabel
|
|
529
|
+
}
|
|
530
|
+
}
|
|
526
531
|
|
|
527
532
|
if (isEqual) {
|
|
528
533
|
option = cachedOption
|
package/src/utils/currency.js
CHANGED
|
@@ -38,7 +38,7 @@ function unformat (input, precision = defaults.precision) {
|
|
|
38
38
|
* @returns
|
|
39
39
|
*/
|
|
40
40
|
function formatMoney (input, toString = false, locale = defaults, customPrecision = false) {
|
|
41
|
-
let inputString =
|
|
41
|
+
let inputString = (`${input}`)
|
|
42
42
|
|
|
43
43
|
// Impede de digitar . ou , porque o formatador já adiciona
|
|
44
44
|
if ((inputString.slice(-1).match(/[.,]/))) {
|
|
@@ -90,32 +90,6 @@ function completeZeros (customPrecision, input, locale) {
|
|
|
90
90
|
return input
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// Impede que seja adicionado um segundo separadador apos o ponto ou a virgula
|
|
94
|
-
function removeSecondSeparator (input, locale) {
|
|
95
|
-
const decimal = locale?.number?.decimal
|
|
96
|
-
|
|
97
|
-
if (!decimal || !input) {
|
|
98
|
-
return input
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Separa a string pelo decimal
|
|
102
|
-
const newInputParts = input.split(decimal)
|
|
103
|
-
|
|
104
|
-
if (newInputParts.length > 0) {
|
|
105
|
-
let newInput = ''
|
|
106
|
-
|
|
107
|
-
// Percorre as partes dividas da string limpando tudo que nao for numerico depois do separador decimal
|
|
108
|
-
for (let i = 0; i < newInputParts.length; i++) {
|
|
109
|
-
newInputParts[i] = i >= 1 ? newInputParts[i].replace(/[^0-9]/g, '') : newInputParts[i] + decimal
|
|
110
|
-
newInput += newInputParts[i]
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return newInput
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return input
|
|
117
|
-
}
|
|
118
|
-
|
|
119
93
|
function onlyNumbers (input) {
|
|
120
94
|
return toStr(input).replace(/\D+/g, '') || '0'
|
|
121
95
|
}
|