<commit_before>import {Component, ElementRef, EventEmitter, forwardRef, Input, Output} from "@angular/core";
import {NG_VALUE_ACCESSOR} from "@angular/forms";
import {ValueAccessorBase} from "../value-acessor-base";
import {dinheiroPlaceholder} from "../constants";

@Component({
  selector: 'dinheiro',
  template: `
    <input class="form-control"
           maxlength="20"
           currencyMask
           id="{{id}}" (keydown)="onKeydown($event)"
           disabled="{{disabled}}"
           [placeholder]="placeholder"
           [(ngModel)]="value"
           (ngModelChange)="notifyChanges($event)"
           (blur)="blurEvt($event)"
           [ngStyle]="style"
           [options]="{ prefix: 'R$ ', thousands: '.', decimal: ',', allowNegative: false }">`,
  providers: [{
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => DinheiroComponent),
    multi: true
  }]
})
export class DinheiroComponent extends ValueAccessorBase<string> {
  pattern: string;

  @Input() style: any;
  @Input() placeholder: string = dinheiroPlaceholder;
  @Input() id: string;

  @Output() blur: EventEmitter<any> = new EventEmitter();

  constructor(private elementRef: ElementRef) {
    super();
  }

  public blurEvt(event): void {
    this.blur.emit(event);
  }

  transform(value: string): string {
    return value;
  }

  onKeydown(event) {
    if (event.ctrlKey && event.keyCode === 65) {
      console.log(this.elementRef);
    }
  }
}<commit_msg>feat: Max Length in dinheiro component<commit_after>import {Component, ElementRef, EventEmitter, forwardRef, Input, Output} from "@angular/core";
import {NG_VALUE_ACCESSOR} from "@angular/forms";
import {ValueAccessorBase} from "../value-acessor-base";
import {dinheiroPlaceholder} from "../constants";

@Component({
  selector: 'dinheiro',
  template: `
    <input class="form-control"
           maxlength="{{maxLength}}"
           currencyMask
           id="{{id}}" (keydown)="onKeydown($event)"
           disabled="{{disabled}}"
           [placeholder]="placeholder"
           [(ngModel)]="value"
           (ngModelChange)="notifyChanges($event)"
           (blur)="blurEvt($event)"
           [ngStyle]="style"
           [options]="{ prefix: 'R$ ', thousands: '.', decimal: ',', allowNegative: false }">`,
  providers: [{
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => DinheiroComponent),
    multi: true
  }]
})
export class DinheiroComponent extends ValueAccessorBase<string> {
  pattern: string;

  @Input() style: any;
  @Input() placeholder: string = dinheiroPlaceholder;
  @Input() id: string;
  @Input() maxLength: number = 15;

  @Output() blur: EventEmitter<any> = new EventEmitter();

  constructor(private elementRef: ElementRef) {
    super();
  }

  public blurEvt(event): void {
    this.blur.emit(event);
  }

  transform(value: string): string {
    return value;
  }

  onKeydown(event) {
    if (event.ctrlKey && event.keyCode === 65) {
      console.log(this.elementRef);
    }
  }
}
{'fraction_non_alphanumeric': 0.15926544240400667, 'fraction_numerical': 0.002671118530884808, 'mean_word_length': 3.478325859491779, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '361700', 'n_tokens_mistral': 938, 'n_tokens_neox': 907, 'n_words': 195}