s4y-ui 2.7.2 → 2.8.2

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.
@@ -576,6 +576,7 @@ class MaskDirective {
576
576
  onFocusOrClick() {
577
577
  const input = this.el.nativeElement;
578
578
  const value = input.value;
579
+ const type = this.mask();
579
580
  const templates = {
580
581
  data: '__/__/____',
581
582
  cpf: '___.___.___-__',
@@ -586,7 +587,10 @@ class MaskDirective {
586
587
  telefone: '(__) _____-____',
587
588
  'telefone-fixo': '(__) ____-____',
588
589
  };
589
- const template = templates[this.mask()];
590
+ // Se não for uma máscara válida, ignora
591
+ if (!type || !(type in templates))
592
+ return;
593
+ const template = templates[type];
590
594
  // Só reposiciona se tiver template definido
591
595
  if (template) {
592
596
  this._setCursorToNextEditable(template, value);