matcha-components 20.96.0 → 20.98.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.
|
@@ -6306,6 +6306,25 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
6306
6306
|
this.decimalMarker === "," /* MaskExpression.COMMA */) {
|
|
6307
6307
|
processedResult = processedResult.replace("," /* MaskExpression.COMMA */, "." /* MaskExpression.DOT */);
|
|
6308
6308
|
}
|
|
6309
|
+
// Para máscaras de separador (currency), processar de forma especial
|
|
6310
|
+
// Remover separador de milhares e converter decimal marker para ponto
|
|
6311
|
+
if (this.maskExpression.startsWith("separator" /* MaskExpression.SEPARATOR */)) {
|
|
6312
|
+
let cleanValue = processedResult;
|
|
6313
|
+
// Remover separador de milhares
|
|
6314
|
+
if (this.thousandSeparator) {
|
|
6315
|
+
cleanValue = cleanValue.split(this.thousandSeparator).join('');
|
|
6316
|
+
}
|
|
6317
|
+
// Converter decimal marker para ponto
|
|
6318
|
+
const markers = Array.isArray(this.decimalMarker)
|
|
6319
|
+
? this.decimalMarker
|
|
6320
|
+
: [this.decimalMarker];
|
|
6321
|
+
for (const marker of markers) {
|
|
6322
|
+
if (marker && marker !== '.') {
|
|
6323
|
+
cleanValue = cleanValue.replace(marker, '.');
|
|
6324
|
+
}
|
|
6325
|
+
}
|
|
6326
|
+
return cleanValue;
|
|
6327
|
+
}
|
|
6309
6328
|
const separatorPrecision = this._retrieveSeparatorPrecision(this.maskExpression);
|
|
6310
6329
|
const separatorValue = this.specialCharacters.length === 0
|
|
6311
6330
|
? this._retrieveSeparatorValue(processedResult)
|