matcha-components 20.105.0 → 20.106.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.
|
@@ -5707,8 +5707,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
5707
5707
|
type: Injectable
|
|
5708
5708
|
}] });
|
|
5709
5709
|
|
|
5710
|
-
// DEBUG: Versão da biblioteca - remover após debug
|
|
5711
|
-
console.log('🎯 MATCHA-MASK VERSION: v101 - MASKEXPRESSION FIX - ' + new Date().toISOString());
|
|
5712
5710
|
class MatchaMaskService extends MatchaMaskApplierService {
|
|
5713
5711
|
constructor() {
|
|
5714
5712
|
super(...arguments);
|
|
@@ -5944,16 +5942,9 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
5944
5942
|
(newInputValue !== this.currentValue && this.writingValue) ||
|
|
5945
5943
|
(this.previousValue === this.currentValue && justPasted);
|
|
5946
5944
|
}
|
|
5947
|
-
console.log('=== applyMask EMIT CHECK ===');
|
|
5948
|
-
console.log('result:', result);
|
|
5949
|
-
console.log('previousValue:', this.previousValue);
|
|
5950
|
-
console.log('currentValue:', this.currentValue);
|
|
5951
|
-
console.log('_emitValue:', this._emitValue);
|
|
5952
|
-
console.log('maskExpression:', this.maskExpression);
|
|
5953
|
-
console.log('dropSpecialCharacters:', this.dropSpecialCharacters);
|
|
5954
5945
|
// Propagate the input value back to the Angular model
|
|
5955
5946
|
// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
|
|
5956
|
-
this._emitValue ? this.formControlResult(result) :
|
|
5947
|
+
this._emitValue ? this.formControlResult(result) : '';
|
|
5957
5948
|
// Handle hidden input and showMaskTyped
|
|
5958
5949
|
if (!this.showMaskTyped || (this.showMaskTyped && this.hiddenInput)) {
|
|
5959
5950
|
if (this.hiddenInput) {
|
|
@@ -6228,47 +6219,31 @@ class MatchaMaskService extends MatchaMaskApplierService {
|
|
|
6228
6219
|
this.maskChanged = false;
|
|
6229
6220
|
// Para máscaras de separador (currency), fazer conversão direta para número
|
|
6230
6221
|
if (this.maskExpression.startsWith("separator" /* MaskExpression.SEPARATOR */) && this.dropSpecialCharacters) {
|
|
6231
|
-
console.log('=== formControlResult CURRENCY DEBUG ===');
|
|
6232
|
-
console.log('maskExpression:', this.maskExpression);
|
|
6233
|
-
console.log('dropSpecialCharacters:', this.dropSpecialCharacters);
|
|
6234
|
-
console.log('inputValue:', inputValue);
|
|
6235
|
-
console.log('prefix:', this.prefix);
|
|
6236
|
-
console.log('thousandSeparator:', this.thousandSeparator);
|
|
6237
|
-
console.log('decimalMarker:', this.decimalMarker);
|
|
6238
6222
|
// Remover prefixo e sufixo
|
|
6239
6223
|
let cleanValue = inputValue;
|
|
6240
6224
|
if (this.prefix) {
|
|
6241
6225
|
cleanValue = cleanValue.replace(this.prefix, '');
|
|
6242
|
-
console.log('after removePrefix:', cleanValue);
|
|
6243
6226
|
}
|
|
6244
6227
|
if (this.suffix) {
|
|
6245
6228
|
cleanValue = cleanValue.replace(this.suffix, '');
|
|
6246
|
-
console.log('after removeSuffix:', cleanValue);
|
|
6247
6229
|
}
|
|
6248
6230
|
// Remover separador de milhares
|
|
6249
6231
|
if (this.thousandSeparator) {
|
|
6250
6232
|
cleanValue = cleanValue.split(this.thousandSeparator).join('');
|
|
6251
|
-
console.log('after removeThousand:', cleanValue);
|
|
6252
6233
|
}
|
|
6253
6234
|
// Converter decimal marker para ponto
|
|
6254
6235
|
const markers = Array.isArray(this.decimalMarker)
|
|
6255
6236
|
? this.decimalMarker
|
|
6256
6237
|
: [this.decimalMarker];
|
|
6257
|
-
console.log('markers to replace:', markers);
|
|
6258
6238
|
for (const marker of markers) {
|
|
6259
6239
|
if (marker && marker !== '.') {
|
|
6260
6240
|
cleanValue = cleanValue.replace(marker, '.');
|
|
6261
|
-
console.log('after replaceMarker ' + marker + ':', cleanValue);
|
|
6262
6241
|
}
|
|
6263
6242
|
}
|
|
6264
6243
|
// Converter para número
|
|
6265
6244
|
const numValue = parseFloat(cleanValue);
|
|
6266
6245
|
const finalValue = isNaN(numValue) ? 0 : numValue;
|
|
6267
|
-
console.log('numValue:', numValue, 'type:', typeof numValue);
|
|
6268
|
-
console.log('finalValue:', finalValue, 'type:', typeof finalValue);
|
|
6269
|
-
console.log('onChange exists:', typeof this.onChange);
|
|
6270
6246
|
this.onChange(outputTransformFn(finalValue));
|
|
6271
|
-
console.log('onChange called with:', finalValue);
|
|
6272
6247
|
return;
|
|
6273
6248
|
}
|
|
6274
6249
|
// Para máscaras de separador, garantir que isNumberValue é true
|