|
@@ -1,11 +1,4 @@
|
|
|
-import {
|
|
|
|
|
- AfterContentInit,
|
|
|
|
|
- ChangeDetectionStrategy,
|
|
|
|
|
- Component,
|
|
|
|
|
- ContentChild,
|
|
|
|
|
- Input,
|
|
|
|
|
- OnInit,
|
|
|
|
|
-} from '@angular/core';
|
|
|
|
|
|
|
+import { Component, ContentChild, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
|
|
|
|
|
|
import { FormFieldControlDirective } from './form-field-control.directive';
|
|
import { FormFieldControlDirective } from './form-field-control.directive';
|
|
|
|
|
|
|
@@ -32,6 +25,7 @@ export class FormFieldComponent implements OnInit {
|
|
|
* will be displayed which allows the field to be edited.
|
|
* will be displayed which allows the field to be edited.
|
|
|
*/
|
|
*/
|
|
|
@Input() readOnlyToggle = false;
|
|
@Input() readOnlyToggle = false;
|
|
|
|
|
+ @Output() readOnlyToggleChange = new EventEmitter<boolean>();
|
|
|
@ContentChild(FormFieldControlDirective, { static: true }) formFieldControl: FormFieldControlDirective;
|
|
@ContentChild(FormFieldControlDirective, { static: true }) formFieldControl: FormFieldControlDirective;
|
|
|
isReadOnly = false;
|
|
isReadOnly = false;
|
|
|
|
|
|
|
@@ -46,6 +40,7 @@ export class FormFieldComponent implements OnInit {
|
|
|
setReadOnly(value: boolean) {
|
|
setReadOnly(value: boolean) {
|
|
|
this.formFieldControl.setReadOnly(value);
|
|
this.formFieldControl.setReadOnly(value);
|
|
|
this.isReadOnly = value;
|
|
this.isReadOnly = value;
|
|
|
|
|
+ this.readOnlyToggleChange.emit(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getErrorMessage(): string | undefined {
|
|
getErrorMessage(): string | undefined {
|