aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/models/formControlModels/inputFormControl.model.ts
blob: 99210af7ad80a1a84a19a60b7d11718d56bdac28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import {FormControlModel} from "./formControl.model";
import {FormControlType} from "./formControlTypes.enum";

export class InputFormControl extends FormControlModel {
  onBlur ?: Function;
  onKeypress?: Function;
  inputType: string = 'text';
  pattern: string;
  preventions: string[];

  constructor(data) {
    super(data);
    this.type = FormControlType.INPUT;
    this.pattern = data.pattern;
    this.onKeypress = data.onKeypress ? data.onKeypress : ()=>{}
    this.onBlur = data.onBlur ? data.onBlur : ()=>{}
  }
}