alarm-event-selector/custom-alarm-event-form/custom-alarm-event-form.component.ts
OnInit
OnDestroy
selector | c8y-custom-alarm-event-form |
templateUrl | ./custom-alarm-event-form.component.html |
Properties |
Methods |
Inputs |
Outputs |
constructor(formBuilder: FormBuilder)
|
||||||
Parameters :
|
defaultColor |
Type : string
|
omitProperties |
Type : OmitSelectorProperties
|
Default value : {}
|
selectedItems |
Type : AlarmOrEvent[]
|
Default value : []
|
target |
Type : IIdentified
|
timelineType |
Type : TimelineType
|
added |
Type : EventEmitter
|
cancel |
Type : EventEmitter
|
add |
add()
|
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
formGroup |
Type : FormGroup
|
valid$ |
Type : Observable<boolean>
|
<form [formGroup]="formGroup" class="p-16">
<div
*ngIf="!omitProperties.color"
class="form-group d-flex a-i-center gap-8"
[title]="'Change color' | translate"
>
<label class="m-0">{{ 'Color' | translate }}</label>
<div class="c8y-colorpicker"
[ngClass]="{
'c8y-colorpicker--event': timelineType === 'EVENT',
'c8y-colorpicker--alarm': timelineType !== 'EVENT'
}"
>
<input
type="color"
formControlName="color"
(click)="$event.stopPropagation()"
/>
<span [style.background-color]="formGroup.value.color">
<i [c8yIcon]="timelineType === 'EVENT' ? 'c8y-events' : 'bell'"></i>
</span>
</div>
</div>
<c8y-alarm-event-attributes-form
formControlName="details"
[timelineType]="timelineType"
[omitProperties]="omitProperties"
[selectedItems]="selectedItems"
></c8y-alarm-event-attributes-form>
<div class="d-flex p-t-16">
<button class="btn btn-default btn-sm" (click)="cancel.emit()">
{{ 'Cancel' | translate }}
</button>
<button
class="btn btn-primary btn-sm"
[disabled]="(valid$ | async) === false"
(click)="add()"
>
<i c8yIcon="plus-circle"></i>
{{ 'Select' | translate }}
</button>
</div>
</form>