|
|
@ -14,7 +14,7 @@ |
|
|
/// limitations under the License.
|
|
|
/// limitations under the License.
|
|
|
///
|
|
|
///
|
|
|
|
|
|
|
|
|
import { Component, DestroyRef, forwardRef, Input } from '@angular/core'; |
|
|
import { booleanAttribute, Component, DestroyRef, forwardRef, Input } from '@angular/core'; |
|
|
import { |
|
|
import { |
|
|
ControlValueAccessor, |
|
|
ControlValueAccessor, |
|
|
FormBuilder, |
|
|
FormBuilder, |
|
|
@ -61,6 +61,9 @@ import { CalculatedFieldArgument } from "@shared/models/calculated-field.models" |
|
|
}) |
|
|
}) |
|
|
export class AlarmRuleFilterPredicateComponent implements ControlValueAccessor, Validator { |
|
|
export class AlarmRuleFilterPredicateComponent implements ControlValueAccessor, Validator { |
|
|
|
|
|
|
|
|
|
|
|
@Input({ transform: booleanAttribute }) |
|
|
|
|
|
disabled: boolean; |
|
|
|
|
|
|
|
|
@Input() |
|
|
@Input() |
|
|
valueType: EntityKeyValueType; |
|
|
valueType: EntityKeyValueType; |
|
|
|
|
|
|
|
|
@ -115,6 +118,15 @@ export class AlarmRuleFilterPredicateComponent implements ControlValueAccessor, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setDisabledState?(isDisabled: boolean): void { |
|
|
|
|
|
this.disabled = isDisabled; |
|
|
|
|
|
if (isDisabled) { |
|
|
|
|
|
this.filterPredicateFormGroup.disable({emitEvent: false}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.filterPredicateFormGroup.enable({emitEvent: false}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
writeValue(predicate: AlarmRuleFilterPredicate): void { |
|
|
writeValue(predicate: AlarmRuleFilterPredicate): void { |
|
|
this.type = predicate.type; |
|
|
this.type = predicate.type; |
|
|
this.filterPredicateFormGroup.patchValue(predicate, {emitEvent: false}); |
|
|
this.filterPredicateFormGroup.patchValue(predicate, {emitEvent: false}); |
|
|
|