matcha-components 20.97.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.
|
@@ -5940,12 +5940,6 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
5940
5940
|
(newInputValue !== this.currentValue && this.writingValue) ||
|
|
5941
5941
|
(this.previousValue === this.currentValue && justPasted);
|
|
5942
5942
|
}
|
|
5943
|
-
// DEBUG: Verificar se formControlResult está sendo chamado
|
|
5944
|
-
console.log('=== applyMask DEBUG ===');
|
|
5945
|
-
console.log('result:', result);
|
|
5946
|
-
console.log('_emitValue:', this._emitValue);
|
|
5947
|
-
console.log('previousValue:', this.previousValue);
|
|
5948
|
-
console.log('currentValue:', this.currentValue);
|
|
5949
5943
|
// Propagate the input value back to the Angular model
|
|
5950
5944
|
// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
|
|
5951
5945
|
this._emitValue ? this.formControlResult(result) : '';
|
|
@@ -6226,35 +6220,15 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
6226
6220
|
if (this.maskExpression.startsWith("separator" /* MaskExpression.SEPARATOR */)) {
|
|
6227
6221
|
this.isNumberValue = true;
|
|
6228
6222
|
}
|
|
6229
|
-
console.log('=== formControlResult DEBUG ===');
|
|
6230
|
-
console.log('inputValue:', inputValue);
|
|
6231
|
-
console.log('isNumberValue:', this.isNumberValue);
|
|
6232
|
-
console.log('dropSpecialCharacters:', this.dropSpecialCharacters);
|
|
6233
6223
|
if (Array.isArray(this.dropSpecialCharacters)) {
|
|
6234
|
-
|
|
6235
|
-
const afterSuffix = this._removeSuffix(afterPrefix);
|
|
6236
|
-
const afterMask = this._removeMask(afterSuffix, this.dropSpecialCharacters);
|
|
6237
|
-
const afterSymbols = this._checkSymbols(afterMask);
|
|
6238
|
-
const afterNumber = this._toNumber(afterSymbols);
|
|
6239
|
-
const finalValue = outputTransformFn(afterNumber);
|
|
6240
|
-
console.log('Array: afterPrefix:', afterPrefix, 'afterSuffix:', afterSuffix, 'afterMask:', afterMask, 'afterSymbols:', afterSymbols, 'afterNumber:', afterNumber, 'final:', finalValue, 'type:', typeof finalValue);
|
|
6241
|
-
this.onChange(finalValue);
|
|
6224
|
+
this.onChange(outputTransformFn(this._toNumber(this._checkSymbols(this._removeMask(this._removeSuffix(this._removePrefix(inputValue)), this.dropSpecialCharacters)))));
|
|
6242
6225
|
}
|
|
6243
6226
|
else if (this.dropSpecialCharacters ||
|
|
6244
6227
|
(!this.dropSpecialCharacters && this.prefix === inputValue)) {
|
|
6245
|
-
|
|
6246
|
-
const afterSuffix = this._removeSuffix(afterPrefix);
|
|
6247
|
-
const afterSymbols = this._checkSymbols(afterSuffix);
|
|
6248
|
-
const afterNumber = this._toNumber(afterSymbols);
|
|
6249
|
-
const finalValue = outputTransformFn(afterNumber);
|
|
6250
|
-
console.log('Boolean: afterPrefix:', afterPrefix, 'afterSuffix:', afterSuffix, 'afterSymbols:', afterSymbols, 'afterNumber:', afterNumber, 'final:', finalValue, 'type:', typeof finalValue);
|
|
6251
|
-
this.onChange(finalValue);
|
|
6228
|
+
this.onChange(outputTransformFn(this._toNumber(this._checkSymbols(this._removeSuffix(this._removePrefix(inputValue))))));
|
|
6252
6229
|
}
|
|
6253
6230
|
else {
|
|
6254
|
-
|
|
6255
|
-
const finalValue = outputTransformFn(afterNumber);
|
|
6256
|
-
console.log('Else: afterNumber:', afterNumber, 'final:', finalValue);
|
|
6257
|
-
this.onChange(finalValue);
|
|
6231
|
+
this.onChange(outputTransformFn(this._toNumber(inputValue)));
|
|
6258
6232
|
}
|
|
6259
6233
|
}
|
|
6260
6234
|
_toNumber(value) {
|
|
@@ -6332,6 +6306,25 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
6332
6306
|
this.decimalMarker === "," /* MaskExpression.COMMA */) {
|
|
6333
6307
|
processedResult = processedResult.replace("," /* MaskExpression.COMMA */, "." /* MaskExpression.DOT */);
|
|
6334
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
|
+
}
|
|
6335
6328
|
const separatorPrecision = this._retrieveSeparatorPrecision(this.maskExpression);
|
|
6336
6329
|
const separatorValue = this.specialCharacters.length === 0
|
|
6337
6330
|
? this._retrieveSeparatorValue(processedResult)
|