54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service';
|
|
import { VisibilityRuleSource } from '../../visibility-rules/models/VisibilityRuleSource';
|
|
import { Field } from '../../models/Field';
|
|
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
|
import { FormGroup, ValidatorFn, AbstractControl, Validators } from '@angular/forms';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
import { FieldBase } from './field-base';
|
|
import { RuleStyle } from '../../entities/common/rulestyle';
|
|
|
|
|
|
@Component({
|
|
selector: 'df-field',
|
|
templateUrl: './dynamic-form-field.component.html',
|
|
// styles: ['.checkBoxLabelCustom {font-weight: 700;}']
|
|
styleUrls: [
|
|
'./dynamic-form-field.component.css'
|
|
],
|
|
encapsulation: ViewEncapsulation.None
|
|
})
|
|
|
|
export class DynamicFormFieldComponent {
|
|
@Input() field: Field;
|
|
@Input() form: FormGroup;
|
|
@Input() pathName:string;
|
|
@Input() path:string;
|
|
|
|
constructor(private route: ActivatedRoute,private visibilityRulesService:VisibilityRulesService) { }
|
|
|
|
|
|
ngOnChanges(changeRecord) {
|
|
|
|
}
|
|
ngOnInit(){
|
|
debugger;
|
|
}
|
|
|
|
clearInput(){
|
|
debugger;
|
|
}
|
|
|
|
get isValid() {
|
|
return this.form.get("value").valid;
|
|
}
|
|
get isValidRequired() {
|
|
return this.form.get("value").hasError("required");
|
|
}
|
|
get isValidPattern() {
|
|
return this.form.get("value").hasError("pattern");
|
|
}
|
|
get isValidCustom() {
|
|
return this.form.get("value").hasError("forbiddenName");
|
|
}
|
|
} |