File

alarm-event-selector/custom-alarm-event-form/custom-alarm-event-form.component.ts

Implements

OnInit OnDestroy

Metadata

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor(formBuilder: FormBuilder)
Parameters :
Name Type Optional
formBuilder FormBuilder No

Inputs

defaultColor
Type : string
omitProperties
Type : OmitSelectorProperties
Default value : {}
selectedItems
Type : AlarmOrEvent[]
Default value : []
target
Type : IIdentified
timelineType
Type : TimelineType

Outputs

added
Type : EventEmitter
cancel
Type : EventEmitter

Methods

add
add()
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

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>

results matching ""

    No results matching ""