matcha-components 20.99.0 → 20.100.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.
|
@@ -6215,6 +6215,35 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
6215
6215
|
: (v) => v;
|
|
6216
6216
|
this.writingValue = false;
|
|
6217
6217
|
this.maskChanged = false;
|
|
6218
|
+
// Para máscaras de separador (currency), fazer conversão direta para número
|
|
6219
|
+
if (this.maskExpression.startsWith("separator" /* MaskExpression.SEPARATOR */) && this.dropSpecialCharacters) {
|
|
6220
|
+
// Remover prefixo e sufixo
|
|
6221
|
+
let cleanValue = inputValue;
|
|
6222
|
+
if (this.prefix) {
|
|
6223
|
+
cleanValue = cleanValue.replace(this.prefix, '');
|
|
6224
|
+
}
|
|
6225
|
+
if (this.suffix) {
|
|
6226
|
+
cleanValue = cleanValue.replace(this.suffix, '');
|
|
6227
|
+
}
|
|
6228
|
+
// Remover separador de milhares
|
|
6229
|
+
if (this.thousandSeparator) {
|
|
6230
|
+
cleanValue = cleanValue.split(this.thousandSeparator).join('');
|
|
6231
|
+
}
|
|
6232
|
+
// Converter decimal marker para ponto
|
|
6233
|
+
const markers = Array.isArray(this.decimalMarker)
|
|
6234
|
+
? this.decimalMarker
|
|
6235
|
+
: [this.decimalMarker];
|
|
6236
|
+
for (const marker of markers) {
|
|
6237
|
+
if (marker && marker !== '.') {
|
|
6238
|
+
cleanValue = cleanValue.replace(marker, '.');
|
|
6239
|
+
}
|
|
6240
|
+
}
|
|
6241
|
+
// Converter para número
|
|
6242
|
+
const numValue = parseFloat(cleanValue);
|
|
6243
|
+
const finalValue = isNaN(numValue) ? 0 : numValue;
|
|
6244
|
+
this.onChange(outputTransformFn(finalValue));
|
|
6245
|
+
return;
|
|
6246
|
+
}
|
|
6218
6247
|
// Para máscaras de separador, garantir que isNumberValue é true
|
|
6219
6248
|
// Isso assegura a conversão correta para número
|
|
6220
6249
|
if (this.maskExpression.startsWith("separator" /* MaskExpression.SEPARATOR */)) {
|