matcha-components 20.110.0 → 20.111.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.
|
@@ -5127,17 +5127,14 @@ class MatchaMaskApplierService {
|
|
|
5127
5127
|
if (!hasDecimalMarker) {
|
|
5128
5128
|
// Sem vírgula: aplicar currencyMode (digitação começando)
|
|
5129
5129
|
shouldApplyCurrencyMode = true;
|
|
5130
|
-
console.log('💰 CurrencyMode: SIM (sem vírgula)');
|
|
5131
5130
|
}
|
|
5132
5131
|
else {
|
|
5133
5132
|
// Com vírgula: verificar se é digitação em andamento ou valor do backend
|
|
5134
5133
|
const parts = processedValue.split(actualDecimalMarker);
|
|
5135
5134
|
const decimalPart = parts[1] || '';
|
|
5136
|
-
console.log('💰 Verificando decimal part:', decimalPart, 'length:', decimalPart.length, 'precision:', precision);
|
|
5137
5135
|
// Se a parte decimal tem mais dígitos que a precisão, é digitação em andamento
|
|
5138
5136
|
// Se tem menos, veio do backend (ex: "10,5" com precisão 2)
|
|
5139
5137
|
shouldApplyCurrencyMode = decimalPart.length > precision;
|
|
5140
|
-
console.log('💰 CurrencyMode:', shouldApplyCurrencyMode ? 'SIM (digitação)' : 'NÃO (backend)');
|
|
5141
5138
|
}
|
|
5142
5139
|
}
|
|
5143
5140
|
if (shouldApplyCurrencyMode) {
|
|
@@ -5731,7 +5728,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
5731
5728
|
type: Injectable
|
|
5732
5729
|
}] });
|
|
5733
5730
|
|
|
5734
|
-
console.log('🎯 MATCHA-MASK VERSION: v105 - CURRENCYMODE SMART DETECTION v2 - ' + new Date().toISOString());
|
|
5731
|
+
// console.log('🎯 MATCHA-MASK VERSION: v105 - CURRENCYMODE SMART DETECTION v2 - ' + new Date().toISOString());
|
|
5735
5732
|
class MatchaMaskService extends MatchaMaskApplierService {
|
|
5736
5733
|
constructor() {
|
|
5737
5734
|
super(...arguments);
|
|
@@ -6835,10 +6832,8 @@ class MatchaMaskCompatibleDirective {
|
|
|
6835
6832
|
// Implementar lógica de teclado se necessário
|
|
6836
6833
|
}
|
|
6837
6834
|
writeValue(value) {
|
|
6838
|
-
console.log('🔵 writeValue chamado - valor:', value, 'tipo:', typeof value);
|
|
6839
6835
|
// Se já estamos escrevendo, não processar novamente (prevenir loop infinito)
|
|
6840
6836
|
if (this._maskService.writingValue) {
|
|
6841
|
-
console.log('⚠️ writeValue ABORTADO - writingValue já é true');
|
|
6842
6837
|
return;
|
|
6843
6838
|
}
|
|
6844
6839
|
this._maskService.writingValue = true;
|
|
@@ -6850,7 +6845,6 @@ class MatchaMaskCompatibleDirective {
|
|
|
6850
6845
|
}
|
|
6851
6846
|
else if (typeof value === 'number') {
|
|
6852
6847
|
inputValue = value.toString();
|
|
6853
|
-
console.log('🔢 Número convertido para string:', inputValue);
|
|
6854
6848
|
}
|
|
6855
6849
|
else {
|
|
6856
6850
|
inputValue = String(value);
|
|
@@ -6864,26 +6858,18 @@ class MatchaMaskCompatibleDirective {
|
|
|
6864
6858
|
if (actualDecimalMarker === ',') {
|
|
6865
6859
|
// Converter ponto para vírgula para que applyMask processe corretamente
|
|
6866
6860
|
inputValue = inputValue.replace('.', ',');
|
|
6867
|
-
console.log('🔄 Converteu ponto para vírgula:', inputValue);
|
|
6868
6861
|
}
|
|
6869
6862
|
}
|
|
6870
6863
|
this._inputValue = inputValue;
|
|
6871
6864
|
// Aplicar máscara se definida
|
|
6872
6865
|
if (this._mask && this._mask.trim() !== '') {
|
|
6873
|
-
console.log('📝 Chamando applyMask com:', inputValue);
|
|
6874
6866
|
const maskedValue = this._maskService.applyMask(inputValue, this._mask);
|
|
6875
|
-
console.log('📝 applyMask retornou:', maskedValue);
|
|
6876
6867
|
// Atualizar o valor do elemento HTML diretamente usando ElementRef
|
|
6877
6868
|
if (this.elementRef && this.elementRef.nativeElement) {
|
|
6878
6869
|
this.elementRef.nativeElement.value = maskedValue;
|
|
6879
|
-
console.log('✅ Elemento HTML atualizado com:', maskedValue);
|
|
6880
|
-
}
|
|
6881
|
-
else {
|
|
6882
|
-
console.log('⚠️ ElementRef não disponível');
|
|
6883
6870
|
}
|
|
6884
6871
|
}
|
|
6885
6872
|
this._maskService.writingValue = false;
|
|
6886
|
-
console.log('✅ writeValue CONCLUÍDO');
|
|
6887
6873
|
}
|
|
6888
6874
|
registerOnChange(fn) {
|
|
6889
6875
|
this.onChange = fn;
|