<commit_before>import {
  Input,
  ViewChild,
  OnInit,
  OnDestroy
} from '@angular/core';
import {
  NgModel,
  RequiredValidator,
} from '@angular/forms';
import {Observable} from 'rxjs/Observable';

import {ValidationService} from '../core/services/validation.service';
import {ValueAccessorBase} from './value-accessor';

import {
  AsyncValidatorArray,
  ValidatorArray,
  ValidationResult,
  message,
  validate,
} from './validate';
import {Mode} from '../core/models/mode.enum';
import {isNullOrUndefined} from 'util';

let indexId = 0;

export abstract class UIElementBase<T> extends ValueAccessorBase<T> implements OnInit, OnDestroy {
  Mode = Mode;

  /**
   * The visualization mode. By default in EDIT mode is displayed
   * @type {Mode}
   */
  @Input() protected mode: Mode = Mode.EDIT;

  /**
   * The identifier of the field that will be used as formControlName
   */
  @Input() protected id = `txt-${indexId++}`;

  /**
   * The title of the field
   */
  @Input() protected title: string;

  /**
   * The custom messages for specific validations
   */
  @Input() protected dataErrorRequired = 'This field is mandatory';
  @Input() protected dataErrorPattern = 'Value does not match required pattern';
  @Input() protected dataErrorMinlength = 'Value must have at least N characters';
  @Input() protected dataErrorMaxlength = 'Value can\' have more than N characters';
  @Input() protected dataErrorNumeric;
  @Input() protected dataErrorDate;
  @Input() protected dataErrorEmail;
  @Input() protected dataErrorHexadecimal;<commit_msg>make public the mode field<commit_after>import {
  Input,
  ViewChild,
  OnInit,
  OnDestroy
} from '@angular/core';
import {
  NgModel,
  RequiredValidator,
} from '@angular/forms';
import {Observable} from 'rxjs/Observable';

import {ValidationService} from '../core/services/validation.service';
import {ValueAccessorBase} from './value-accessor';

import {
  AsyncValidatorArray,
  ValidatorArray,
  ValidationResult,
  message,
  validate,
} from './validate';
import {Mode} from '../core/models/mode.enum';
import {isNullOrUndefined} from 'util';

let indexId = 0;

export abstract class UIElementBase<T> extends ValueAccessorBase<T> implements OnInit, OnDestroy {
  Mode = Mode;

  /**
   * The visualization mode. By default in EDIT mode is displayed
   * @type {Mode}
   */
  @Input() mode: Mode = Mode.EDIT;

  /**
   * The identifier of the field that will be used as formControlName
   */
  @Input() public id = `txt-${indexId++}`;

  /**
   * The title of the field
   */
  @Input() public title: string;

  /**
   * The custom messages for specific validations
   */
  @Input() protected dataErrorRequired = 'This field is mandatory';
  @Input() protected dataErrorPattern = 'Value does not match required pattern';
  @Input() protected dataErrorMinlength = 'Value must have at least N characters';
  @Input() protected dataErrorMaxlength = 'Value can\' have more than N characters';
  @Input() protected dataErrorNumeric;
  @Input() protected dataErrorDate;
  @Input() protected dataErrorEmail;
  @Input() protected dataErrorHexadecimal;
{'fraction_non_alphanumeric': 0.11908593498551658, 'fraction_numerical': 0.000643707756678468, 'mean_word_length': 4.197324414715719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '352855', 'n_tokens_mistral': 906, 'n_tokens_neox': 892, 'n_words': 300}