matcha-components 20.99.0 → 20.101.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,51 @@ 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
+ console.log('=== formControlResult CURRENCY DEBUG ===');
6221
+ console.log('maskExpression:', this.maskExpression);
6222
+ console.log('dropSpecialCharacters:', this.dropSpecialCharacters);
6223
+ console.log('inputValue:', inputValue);
6224
+ console.log('prefix:', this.prefix);
6225
+ console.log('thousandSeparator:', this.thousandSeparator);
6226
+ console.log('decimalMarker:', this.decimalMarker);
6227
+ // Remover prefixo e sufixo
6228
+ let cleanValue = inputValue;
6229
+ if (this.prefix) {
6230
+ cleanValue = cleanValue.replace(this.prefix, '');
6231
+ console.log('after removePrefix:', cleanValue);
6232
+ }
6233
+ if (this.suffix) {
6234
+ cleanValue = cleanValue.replace(this.suffix, '');
6235
+ console.log('after removeSuffix:', cleanValue);
6236
+ }
6237
+ // Remover separador de milhares
6238
+ if (this.thousandSeparator) {
6239
+ cleanValue = cleanValue.split(this.thousandSeparator).join('');
6240
+ console.log('after removeThousand:', cleanValue);
6241
+ }
6242
+ // Converter decimal marker para ponto
6243
+ const markers = Array.isArray(this.decimalMarker)
6244
+ ? this.decimalMarker
6245
+ : [this.decimalMarker];
6246
+ console.log('markers to replace:', markers);
6247
+ for (const marker of markers) {
6248
+ if (marker && marker !== '.') {
6249
+ cleanValue = cleanValue.replace(marker, '.');
6250
+ console.log('after replaceMarker ' + marker + ':', cleanValue);
6251
+ }
6252
+ }
6253
+ // Converter para número
6254
+ const numValue = parseFloat(cleanValue);
6255
+ const finalValue = isNaN(numValue) ? 0 : numValue;
6256
+ console.log('numValue:', numValue, 'type:', typeof numValue);
6257
+ console.log('finalValue:', finalValue, 'type:', typeof finalValue);
6258
+ console.log('onChange exists:', typeof this.onChange);
6259
+ this.onChange(outputTransformFn(finalValue));
6260
+ console.log('onChange called with:', finalValue);
6261
+ return;
6262
+ }
6218
6263
  // Para máscaras de separador, garantir que isNumberValue é true
6219
6264
  // Isso assegura a conversão correta para número
6220
6265
  if (this.maskExpression.startsWith("separator" /* MaskExpression.SEPARATOR */)) {