File

alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.ts

Implements

ControlValueAccessor Validator OnInit OnDestroy

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(alarmEventModalService: AlarmEventSelectorModalService, alarmEventSelectService: AlarmEventSelectorService, formBuilder: FormBuilder, widgetComponent: WidgetConfigComponent)
Parameters :
Name Type Optional
alarmEventModalService AlarmEventSelectorModalService No
alarmEventSelectService AlarmEventSelectorService No
formBuilder FormBuilder No
widgetComponent WidgetConfigComponent No

Inputs

activeToggleAsSwitch
Type : boolean
Default value : true
addButtonLabel
Type : string
canDragAndDrop
Type : boolean
Default value : true
canEdit
Type : boolean
Default value : true
canRemove
Type : boolean
Default value : true
config
Type : Partial<AlarmEventSelectorModalOptions>
Default value : {}

The configuration for the alarms-events selector modal.

hideSource
Type : boolean
Default value : false
inline
Type : boolean
Default value : false
omitProperties
Type : OmitSelectorProperties
Default value : { color: false, label: false }
timelineType
Type : TimelineType
Default value : 'ALARM'
title
Type : string

Methods

add
add()
Returns : void
drop
drop(event: CdkDragDrop<AlarmOrEvent[]>)
Parameters :
Name Type Optional
event CdkDragDrop<AlarmOrEvent[]> No
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void
onItemRemoved
onItemRemoved(index: number)
Parameters :
Name Type Optional
index number No
Returns : void
registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
validate
validate(_control: AbstractControl)
Parameters :
Name Type Optional
_control AbstractControl No
Returns : ValidationErrors
writeValue
writeValue(val: AlarmOrEvent[])
Parameters :
Name Type Optional
val AlarmOrEvent[] No
Returns : void

Properties

emptyState
Type : EmptyStateComponent
Decorators :
@ContentChild(EmptyStateComponent)
formArray
Type : FormArray
timelineTypeTexts
Type : TimelineTypeTexts
<div
  class="card-header separator sticky-top bg-component"
  *ngIf="inline"
>
  <span class="card-title h4">{{ title | translate }}</span>
</div>

<c8y-list-group
  class="flex-grow ff-scroll-fix cdk-droplist"
  cdkDropList
  (cdkDropListDropped)="drop($event)"
  [cdkDropListDisabled]="formArray.controls?.length < 2"
>
  <div
    class="p-t-8"
    *ngIf="!formArray.controls?.length"
  >
    <ng-content select="c8y-ui-empty-state"></ng-content>
    <c8y-ui-empty-state
      class="p-t-8"
      [icon]="timelineTypeTexts.emptyStateIcon"
      [title]="timelineTypeTexts.emptyStateTitle | translate"
      [subtitle]="timelineTypeTexts.emptyStateSubtitle | translate"
      *ngIf="!emptyState"
      [horizontal]="true"
    ></c8y-ui-empty-state>
  </div>
  <div
    *ngFor="let itemForm of formArray.controls; let index = index"
    [formGroup]="itemForm"
  >
    <c8y-alarm-event-selector-list-item
      class="d-block"
      cdkDrag
      [cdkDragDisabled]="!canDragAndDrop"
      formControlName="details"
      [showAddRemoveButton]="false"
      [optionToRemove]="canRemove"
      [showActiveToggle]="true"
      [timelineType]="timelineType"
      [allowItemEdit]="canEdit"
      [hideSource]="hideSource"
      [displayAsSwitch]="activeToggleAsSwitch"
      [omitProperties]="omitProperties"
      (removed)="onItemRemoved(index)"
    >
      <c8y-li-drag-handle
        title="{{ 'Click and drag to reorder' | translate }}"
        cdkDragHandle
        *ngIf="canDragAndDrop"
      >
        <i c8yIcon="drag-reorder"></i>
      </c8y-li-drag-handle>
    </c8y-alarm-event-selector-list-item>
  </div>
</c8y-list-group>

<div class="card-footer bg-inherit separator-bottom">
  <button
    class="btn btn-default btn-sm"
    [title]="addButtonLabel | translate"
    type="button"
    [ngClass]="{ 'btn-block': inline }"
    (click)="add()"
  >
    <i
      c8yIcon="plus-circle"
      *ngIf="canDragAndDrop"
    ></i>
    {{ addButtonLabel | translate }}
  </button>
</div>

results matching ""

    No results matching ""